runtime 1.0.0
Checked CEL programs, owned values, and reusable execution stacks
Loading...
Searching...
No Matches
cel::stack_requirements Struct Reference

Describes statically known canonical frame storage for a frozen ordinary program. Extent and slots are peak simultaneous requirements, not cumulative instruction costs. Defaults to alignment one with no frame bytes or live slots. Composite payload allocations, concrete callback temporaries, and arbitrary callback or nested external stack work are not inferred. Result destinations remain caller-owned. Example: auto r = program.requirements().for_prefix(stack.cursor(), stack.depth());. More...

#include <cel/runtime/dyn_segment.hpp>

Public Member Functions

stack_reservation for_prefix (std::size_t cursor, std::size_t depth) const
 Returns checked conservative total capacities for an existing caller prefix. Rounds cursor up to alignment, then adds frame_extent; adds depth to live_slots. Existing storage alignment is retained by raw_stack::reserve, never narrowed. Throws invalid_argument for invalid alignment and overflow_error for either sum. Reserve before entering a frame, using cursor/depth measured without intervening mutation. No allocation or signature traversal occurs. Example: auto r = requirements.for_prefix(stack.cursor(), stack.depth()); stack.reserve(r.bytes.size, r.bytes.alignment); stack.reserve_depth(r.slots);.

Public Attributes

std::size_t alignment
 Gives maximum intermediate canonical alignment.
std::size_t frame_extent
 Gives peak canonical extent for a zero-cursor frame.
std::size_t live_slots
 Gives peak simultaneously live frame operands.

Detailed Description

Describes statically known canonical frame storage for a frozen ordinary program. Extent and slots are peak simultaneous requirements, not cumulative instruction costs. Defaults to alignment one with no frame bytes or live slots. Composite payload allocations, concrete callback temporaries, and arbitrary callback or nested external stack work are not inferred. Result destinations remain caller-owned. Example: auto r = program.requirements().for_prefix(stack.cursor(), stack.depth());.


The documentation for this struct was generated from the following file: