|
runtime 1.1.4
Checked CEL programs, owned values, and reusable execution stacks
|
The statically known storage requirements of a frozen ordinary program. 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. | |
The statically known storage requirements of 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());.
| stack_reservation cel::stack_requirements::for_prefix | ( | std::size_t | cursor, |
| std::size_t | depth ) const |
Returns checked conservative total capacities for an existing caller prefix.
Includes alignment padding and the live byte/depth prefix. Reserve before entering a frame, using cursor/depth measured without intervening mutation. raw_stack::reserve retains any higher existing alignment. Does not allocate or traverse type metadata.
Throws std::invalid_argument for invalid alignment and std::overflow_error if either total capacity is unrepresentable.
Example: auto r = requirements.for_prefix(stack.cursor(), stack.depth()); stack.reserve(r.bytes.size, r.bytes.alignment); stack.reserve_depth(r.slots);.