Silk

silk/execution_storage

Profiles: aarch64-apple-darwin, aarch64-unknown-linux-gnu, wasm32-unknown-unknown, x86_64-unknown-linux-gnu.

Explicit per-instance storage for compiler-private execution frames.

Details

Each state owns its limit, accounting and reservations. There is no shared counter or environment lookup. Allocation and release use the selected target's declared allocator.

Gotchas

Raw frame access is unsafe. A frame is valid only until release or destruction of its state. One state requires exclusive use; independent states can use a concurrent host allocator.

Import as ExecutionStorage with import silk.execution_storage { ExecutionStorage }.

Public declarations: 1.

ExecutionStorage

pub struct ExecutionStorage

An affine state that owns its private-frame reservations and capacity limit.

Associated function ExecutionStorage.make

pub effect<'static> fn make(limit: usize) -> ExecutionStorage ! OutOfMemoryError

Creates an independent state whose frame reservations can charge at most limit bytes.

Details

Charges include each reservation header and alignment padding. The fixed state allocation is excluded. Refusal acquires no state and reports OutOfMemoryError.

Method ExecutionStorage.used

pub fn used<'life0>(self: &'life0 silk/execution_storage.ExecutionStorage) -> usize

Returns the bytes charged to this state's current frame reservations.

Method ExecutionStorage.acquire

pub unsafe fn acquire<'life0>(self: &'life0 mut silk/execution_storage.ExecutionStorage, size: usize, alignment: usize) -> ?*mut u8

Acquires a fixed-address frame or returns null without retaining a partial reservation.

Gotchas

The caller must initialize bytes before reading, obey the requested extent, and stop using the pointer before release or state destruction. A zero size or invalid alignment returns null.

Method ExecutionStorage.release

pub unsafe fn release<'life0>(self: &'life0 mut silk/execution_storage.ExecutionStorage, frame: ?*mut u8) -> ()

Releases one frame acquired from this state and removes its charge.

Gotchas

The caller must finish semantic cleanup and stop every access before releasing the frame.

Implementation Drop for ExecutionStorage

impl Drop for ExecutionStorage

On this page