Table of Contents

Interface IHeap

Namespace
Echo.Memory.Heap
Assembly
Echo.dll

Provides members for allocating and freeing chunks of memory.

public interface IHeap : IMemorySpace
Inherited Members

Methods

Allocate(uint, bool)

Allocates a chunk of uninitialized memory in the heap.

long Allocate(uint size, bool initialize)

Parameters

size uint

The size of the chunk in bytes.

initialize bool

A value indicating whether the chunk of memory should be cleared out with zeroes.

Returns

long

The address of the allocated chunk.

Free(long)

Releases a chunk of memory in the heap.

void Free(long address)

Parameters

address long

The address of the chunk to free.

GetAllocatedChunks()

Gets a collection of all chunk address ranges within the heap that are currently allocated.

IEnumerable<AddressRange> GetAllocatedChunks()

Returns

IEnumerable<AddressRange>

The ranges.

GetChunkSize(long)

Gets the size of the chunk that was allocated at the provided address.

uint GetChunkSize(long address)

Parameters

address long

The address of the chunk.

Returns

uint

The size in bytes.

GetChunkSpan(long)

Obtains a writable bit vector slice that spans the entire chunk at a provided address.

BitVectorSpan GetChunkSpan(long address)

Parameters

address long

The address of the chunk

Returns

BitVectorSpan

The chunk slice.