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:
34
UnmangedMMU/Handles/IMemoryHandleT.cs
Normal file
34
UnmangedMMU/Handles/IMemoryHandleT.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using UnmanagedMMU.Allocators;
|
||||
|
||||
namespace UnmanagedMMU.Handles
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Interface that represents a typed handle to unmanaged memory.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">
|
||||
/// The unmanaged element type stored in the underlying memory block.
|
||||
/// </typeparam>
|
||||
public unsafe interface IMemoryHandle<T> : IMemoryHandle, IDisposable where T : unmanaged
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Gets the typed <typeparamref name="T"/> pointer to the underlying unmanaged memory block.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The pointer becomes invalid after the handle is disposed.
|
||||
/// </remarks>
|
||||
new T* Pointer { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of elements contained in this handle.
|
||||
/// </summary>
|
||||
nuint Length { get; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns the underlying unmanaged memory block held by this handle back to the owning <see cref="IUnmanagedMemoryOwner"/> instance
|
||||
/// </summary>
|
||||
new void Dispose() { }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user