vendoring NetVips

This commit is contained in:
Renjaya Raga Zenta 2025-07-31 00:17:59 +07:00
parent 36a0f8d39c
commit 33e9d5f43a
41 changed files with 21749 additions and 0 deletions

39
vendor/NetVips/Stats.cs vendored Normal file
View file

@ -0,0 +1,39 @@
using NetVips.Internal;
namespace NetVips;
/// <summary>
/// A class that provides the statistics of memory usage and opened files.
/// </summary>
/// <remarks>
/// libvips watches the total amount of live tracked memory and
/// uses this information to decide when to trim caches.
/// </remarks>
public static class Stats
{
/// <summary>
/// Get the number of active allocations.
/// </summary>
public static int Allocations => Vips.TrackedGetAllocs();
/// <summary>
/// Get the number of bytes currently allocated `vips_malloc()` and friends.
/// </summary>
/// <remarks>
/// libvips uses this figure to decide when to start dropping cache.
/// </remarks>
public static int Mem => Vips.TrackedGetMem();
/// <summary>
/// Returns the largest number of bytes simultaneously allocated via vips_tracked_malloc().
/// </summary>
/// <remarks>
/// Handy for estimating max memory requirements for a program.
/// </remarks>
public static ulong MemHighwater => Vips.TrackedGetMemHighwater();
/// <summary>
/// Get the number of open files.
/// </summary>
public static int Files => Vips.TrackedGetFiles();
}