pub type DebugValueStack = SlotStack<Option<GcRef>>;Expand description
The runtime’s one reservation of per-call debug value slots.
Option<GcRef> rather than the shadow stack’s *mut GcHeader, for two
reasons stated in this module’s header: the None niche means a zeroed claim
is a run of “no value yet” (F18), and the distinct type is what keeps
impl RootSet for SlotStackHeader<*mut GcHeader> from applying here. The
collector must not trace these slots; ADR-044 decision 2 nulls a shadow
slot the moment its local dies, and this stack deliberately does not.
It does scan them, after every sweep, and mark the ones whose object that
sweep reclaimed — see DebugFrameStackHeader::clear_reclaimed and
ADR-106. That is the difference between keeping a value alive and keeping
a slot valid, and only the second is this stack’s business.
So a slot’s word is one of three things, not two: zero (nothing written),
RECLAIMED_WORD (written, then collected), or a value. Option<GcRef>
spells the first and the third; the second is a reserved word inside the
Some half, which costs nothing because a reference slot’s inhabitants are
aligned pointers.
Aliased Type§
pub struct DebugValueStack { /* private fields */ }