- Make image result/info structs readonly; improve error handling and memory safety in image library - Introduce IJobScheduler interface; move job scheduling docs to interface - Remove "index 0 invalid" convention from slot/sparse maps; fix Count logic - Add Owner<T> for disposable value types in low-level utilities - Improve ObjectPool<T> thread safety and logic - Change List<T>.RemoveAndSwapBack to return bool - Remove unsafe methods from generated math types; add debug range checks - Update benchmarks and enable collection checks in tests - Improve documentation, comments, and error messages - Bump assembly versions across all projects
27 lines
536 B
C#
27 lines
536 B
C#
using System.Threading;
|
|
|
|
namespace Misaki.HighPerformance.Image.Runtime
|
|
{
|
|
internal static class MemoryStats
|
|
{
|
|
private static int s_allocations;
|
|
|
|
public static int Allocations
|
|
{
|
|
get
|
|
{
|
|
return s_allocations;
|
|
}
|
|
}
|
|
|
|
internal static void Allocated()
|
|
{
|
|
Interlocked.Increment(ref s_allocations);
|
|
}
|
|
|
|
internal static void Freed()
|
|
{
|
|
Interlocked.Decrement(ref s_allocations);
|
|
}
|
|
}
|
|
} |