Table of Contents

Interface ISessionStorage

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

Holds the actual value bound at each address in a session's memory space, as either a typed IBindingHandle or, for the handful of MS-VBAL constructs that operate on raw storage (LSet between two UDT variables; MS-VBAL only ever allows this and the already-value-level fixed-length String form), a plain byte buffer. An address is one kind or the other, never both.

public interface ISessionStorage

Remarks

ISessionMemoryAllocator deliberately does not cover this: it only accounts for allocation size and fragmentation, never values. An ISessionStorage depends on one to reserve address space, then binds the caller's value at the resulting address.

Methods

TryAllocate(int, IBindingHandle, out MemoryAddress)

Reserves size bytes through the underlying ISessionMemoryAllocator and binds handle at the resulting address.

bool TryAllocate(int size, IBindingHandle handle, out MemoryAddress address)

Parameters

size int
handle IBindingHandle
address MemoryAddress

Returns

bool

false if the underlying memory space is exhausted.

TryAllocateBytes(int, out MemoryAddress)

Reserves size bytes through the underlying ISessionMemoryAllocator as a raw byte buffer, zero-initialized, at the resulting address.

bool TryAllocateBytes(int size, out MemoryAddress address)

Parameters

size int
address MemoryAddress

Returns

bool

false if the underlying memory space is exhausted.

TryDeallocate(MemoryAddress)

Frees the binding and the underlying storage at address.

bool TryDeallocate(MemoryAddress address)

Parameters

address MemoryAddress

Returns

bool

true if a binding existed at address and was released.

TryRead(MemoryAddress, out IBindingHandle?)

Gets the IBindingHandle bound at address.

bool TryRead(MemoryAddress address, out IBindingHandle? handle)

Parameters

address MemoryAddress
handle IBindingHandle

Returns

bool

TryReadBytes(MemoryAddress, out byte[]?)

Gets a copy of the byte buffer at address.

bool TryReadBytes(MemoryAddress address, out byte[]? bytes)

Parameters

address MemoryAddress
bytes byte[]

Returns

bool

false if address is not a byte-backed allocation.

TryRebind(MemoryAddress, IBindingHandle)

Replaces the IBindingHandle currently bound at address, e.g. to let a location-identified value (a UDT, an array) bind itself to the very address that was just reserved for it.

bool TryRebind(MemoryAddress address, IBindingHandle handle)

Parameters

address MemoryAddress
handle IBindingHandle

Returns

bool

true if address was already allocated and its binding was replaced.

TryWriteBytes(MemoryAddress, ReadOnlySpan<byte>)

Replaces the byte buffer at address with a copy of bytes. The new buffer's length need not match the original allocation's.

bool TryWriteBytes(MemoryAddress address, ReadOnlySpan<byte> bytes)

Parameters

address MemoryAddress
bytes ReadOnlySpan<byte>

Returns

bool

false if address is not a byte-backed allocation.