Added SegmentedPool
This commit is contained in:
16
UnmangedMMU/Allocators/DefaultUnmanagedAllocator.cs
Normal file
16
UnmangedMMU/Allocators/DefaultUnmanagedAllocator.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace UnmanagedMMU.Allocators
|
||||
{
|
||||
/// <summary>
|
||||
/// Wrapper class around <see cref="NativeMemory.Alloc(nuint)"/> and <see cref="NativeMemory.Free(void*)"/>.
|
||||
/// </summary>
|
||||
internal sealed unsafe class DefaultUnmanagedAllocator : IUnmanagedAllocator
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public void* Alloc(nuint size) => NativeMemory.Alloc(size);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void Free(void* ptr) => NativeMemory.Free(ptr);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user