using Misaki.HighPerformance.LowLevel.Collections; namespace Misaki.HighPerformance.LowLevel.Contracts; using unsafe AllocFunc = delegate* unmanaged; using unsafe FreeFunc = delegate* unmanaged; using unsafe ReallocFunc = delegate* unmanaged; public unsafe readonly struct AllocationHandle { public void* Allocator { get; } public AllocFunc Alloc { get; } public ReallocFunc Realloc { get; } public FreeFunc Free { get; } public AllocationHandle(void* allocator, AllocFunc alloc, ReallocFunc realloc, FreeFunc free) { Allocator = allocator; Alloc = alloc; Realloc = realloc; Free = free; } } /// /// Represents an allocator interface for managing memory allocations. /// /// /// The allocator must be static or pined to a specific memory region. /// public unsafe interface IAllocator { public ref AllocationHandle Handle { get; } }