Skip to main content

ShadowStackHeader

Type Alias ShadowStackHeader 

Source
pub type ShadowStackHeader = SlotStackHeader<*mut GcHeader>;
Expand description

The header generated code bump-allocates against.

Aliased Type§

pub struct ShadowStackHeader { /* private fields */ }

Trait Implementations§

Source§

impl RootSet for ShadowStackHeader

Source§

fn push_roots(&self, out: &mut Vec<GcRef>)

One linear pass over every claimed slot.

This yields exactly every live frame’s roots: each frame occupies exactly its own slot_count slots and the frames partition [base, top), so the concatenation is the union of every live frame’s slots[..slot_count]. Walking a parent-pointer chain instead would cost a level of native recursion and an allocation per frame inside Heap::mark, 8000 of each at the deepest legal recursion.

Slots above top may still hold pointers a popped frame wrote. That is harmless, and needs no invariant to make it so: they are never scanned, and the next push zeroes exactly the run it claims before any safepoint can read it.