|
runtime 1.0.0
Checked CEL programs, owned values, and reusable execution stacks
|
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);. | |
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());.