Represents memory management methods as a stack
Class
namespace StackMemoryCollections.Class
{
public unsafe class StackMemory : IDisposable
}Struct
namespace StackMemoryCollections.Struct
{
public unsafe struct StackMemory : IDisposable
}Implements IDisposable
| Name | ForType |
|---|---|
| StackMemory() | Struct |
| StackMemory(nuint) | All |
| Name | ForType |
|---|---|
| Start | All |
| Current | All |
| ByteCount | All |
| FreeByteCount | All |
| Name | ForType |
|---|---|
| AllocateMemory(nuint) | All |
| TryAllocateMemory(nuint, out void*) | All |
| FreeMemory() | All |
| TryFreeMemory() | All |
| Dispose() | All |
unsafe
{
using (var memory = new StackMemoryCollections.Struct.StackMemory(16))//allocate 16 bytes
{
}
}unsafe
{
using (var memory = new StackMemoryCollections.Struct.StackMemory())//throw error "Constructor without parameters is not supported"
{
}
}unsafe
{
using (var memory = new StackMemoryCollections.Class.StackMemory(16))//allocate 16 bytes
{
}
}