Skip to main content

SCRATCHPAD_SLOT

Constant SCRATCHPAD_SLOT 

Source
pub const SCRATCHPAD_SLOT: u8 = 0;
Expand description

The scratchpad slot: the single cap-shaped data-flow channel between a caller and callee. Its contents may be freely mutated and reset to empty, but the slot itself is “mutably pinned” — MGMT_MOVE/MGMT_SWAP of this slot trap. On CALL the caller’s scratchpad moves to the callee; on HALT/reply the callee’s moves back to the caller; so the running Instance always holds the scratchpad here, and every other frame’s slot[0] is empty (one owner — see the data-flow principle). The fuzz / kernel return path hands the top-level Instance’s slot[0] Cap::Data back as the invocation result.