Skip to main content

reactivate_dangling_active_stack_members

Function reactivate_dangling_active_stack_members 

Source
fn reactivate_dangling_active_stack_members(
    node: &mut LayoutNode,
    live_block_ids: &HashSet<String>,
) -> usize
Expand description

Recursively repair leaves whose ACTIVE block (data.block_id) is dangling but a live sibling still exists in block_stack: drop the dead entry from the stack and reactivate the first remaining live member (block_id/active_block_id both updated). Leaves with no live sibling are left with block_id still pointing at the dangling id — the caller’s whole-leaf pass then correctly deletes them, same as before this function existed. Returns the number of leaves repaired.