3 void FreeEvent::apply_to(Snapshot
*snapshot
) {
4 qDebug("Asked to apply FreeEvent to snapshot #%li . . .", (long int)snapshot
->get_snapshot_id());
5 BiTreeNode
*node
= snapshot
->get_head_node();
8 quint8 max_depth
= snapshot
->get_max_tree_depth();
9 /* First, traverse the tree to find the right spot. Do not create any
10 nodes required to get there -- this is a removal, not an addition! */
11 for(quint8 depth
= 0; depth
< max_depth
; depth
++) {
12 bool bit
= MemoryAddress(address
<< depth
) & 0x01;
14 if(node
->get_left() != NULL
) node
= node
->get_left();
18 if(node
->get_right() != NULL
) node
= node
->get_right();
22 Block
*block
= node
->get_block(address
);
23 if(block
) node
->remove_block(block
);