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:
27
UnmangedMMU/Handles/IMemoryHandle.cs
Normal file
27
UnmangedMMU/Handles/IMemoryHandle.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user