Table of Contents

Interface ISessionMemoryAllocator

Namespace
RDCore.SDK.Runtime.Abstract.Execution
Assembly
RDCore.SDK.dll

Allocates and frees blocks within an execution session's memory space, and reports allocation and fragmentation statistics.

public interface ISessionMemoryAllocator

Remarks

⚖️RDCore provides an implementation of this interface licensed under GPLv3.

Properties

Info

Current allocation and fragmentation statistics for this session's memory space.

SessionMemoryInfo Info { get; }

Property Value

SessionMemoryInfo

Methods

TryAllocate(int, out MemoryAddress)

Allocates the specified number of bytes in the memory space of this session.

bool TryAllocate(int size, out MemoryAddress address)

Parameters

size int

The desired size of the allocation.

address MemoryAddress

The start of the allocated address space.

Returns

bool

true if the specified number of bytes can be allocated, false otherwise.

TryDeallocate(MemoryAddress, out SessionMemoryBlock)

Frees the block starting at address.

bool TryDeallocate(MemoryAddress address, out SessionMemoryBlock block)

Parameters

address MemoryAddress
block SessionMemoryBlock

Returns

bool

TryFindBlock(MemoryAddress, out SessionMemoryBlock)

Finds the allocated block that address falls inside — the first byte of one, or any byte within it.

bool TryFindBlock(MemoryAddress address, out SessionMemoryBlock block)

Parameters

address MemoryAddress

Any address, allocated or not.

block SessionMemoryBlock

The block containing it.

Returns

bool

false if nothing is allocated at that address.

Remarks

Allocation is the only thing that knows how big anything is, so it is the only thing that can answer "what lives at this address". Direct byte-level access to a session's memory needs that answer; nothing else does.