Updated the SegmentedPool to allow for zeroing of allocations and for returning a pointer to allocated memory to allow for use in unsafe structs (#2)

This commit was merged in pull request #2.
This commit is contained in:
Jim
2026-03-20 17:51:15 +00:00
parent dfbdf905fe
commit c2150acb2c
15 changed files with 2788 additions and 674 deletions

View File

@@ -0,0 +1,27 @@
using UnmanagedMMU.Allocators;
namespace UnmanagedMMU.Handles
{
/// <summary>
/// Interface that represents an untyped handle to unmanaged memory.
/// </summary>
public unsafe interface IMemoryHandle
{
/// <summary>
/// Gets the raw pointer to the underlying unmanaged memory block.
/// </summary>
/// <remarks>
/// The returned pointer is valid only for the lifetime of the allocator
/// that created this <see cref="IMemoryHandle"/>.
/// </remarks>
void* Pointer { get; }
/// <summary>
/// Gets the number of bytes in the unmanaged memory block
/// represented by this <see cref="IMemoryHandle"/>.
/// </summary>
nuint ByteCount { get; }
}
}