Table of Contents

Interface ISymbolStorage

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

The storage a running session binds its symbols to: the binding currently associated with a symbol, or held at an address of the session's memory map.

public interface ISymbolStorage

Remarks

Storage only: what a name binds to is ISymbolResolver's, and a resolver of a running session is both (IRuntimeSymbolResolver).

Methods

GetValue(Symbol)

Gets the IBindingHandle currently associated with the specified Symbol.

IBindingHandle GetValue(Symbol symbol)

Parameters

symbol Symbol

The Symbol to retrieve the currently associated binding for.

Returns

IBindingHandle

TryAllocate(Symbol, VBTypedValue, out MemoryAddress)

Reserves storage sized for value and binds it to symbol, chiefly for a Static local's first-call allocation (MS-VBAL §5.4.3.1: module extent, so the storage outlives the local's frame). It does not affect name resolution: a symbol's name resolves through its declaring symbol (a procedure's Locals and Parameters). Calling it for a symbol that is already allocated frees the previous allocation and makes a new one.

bool TryAllocate(Symbol symbol, VBTypedValue value, out MemoryAddress address)

Parameters

symbol Symbol

The symbol to reserve storage for.

value VBTypedValue

The value to seed the new storage with.

address MemoryAddress

The reserved address, on success.

Returns

bool

false if the underlying memory space is exhausted.

TryGetAddress(Symbol, out MemoryAddress)

Gets the MemoryAddress currently reserved for symbol, if any: what a ByRef argument binds to (MS-VBAL §5.3.1.11: "a reference parameter binding... referring to the variable referenced by the argument's expression").

bool TryGetAddress(Symbol symbol, out MemoryAddress address)

Parameters

symbol Symbol

The Symbol whose address to look up.

address MemoryAddress

The reserved address, if symbol is currently allocated.

Returns

bool

TryRead(MemoryAddress, out IBindingHandle?)

Gets the IBindingHandle at the specified address in the runtime memory map.

bool TryRead(MemoryAddress address, out IBindingHandle? value)

Parameters

address MemoryAddress

The memory address to read.

value IBindingHandle

The retrieved binding, if successful.

Returns

bool