Skip to content

Latest commit

 

History

History

Readme.md

Definition

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

Constructors

Name ForType
StackMemory() Struct
StackMemory(nuint) All

Properties

Name ForType
Start All
Current All
ByteCount All
FreeByteCount All

Methods

Name ForType
AllocateMemory(nuint) All
TryAllocateMemory(nuint, out void*) All
FreeMemory() All
TryFreeMemory() All
Dispose() All

Examples

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
    {
    }
}