Interface IHeap
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
sizeuintThe size of the chunk in bytes.
initializeboolA 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
addresslongThe 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
addresslongThe 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
addresslongThe address of the chunk
Returns
- BitVectorSpan
The chunk slice.