Previous: , Up: Weak References   [Contents][Index]


10.7.3 Reference barriers

The garbage collector may break an ephemeron if it can prove that the key is not strongly reachable. To ensure that it does not do so before a certain point in a program, the program can invoke a reference barrier on the key by calling the reference-barrier procedure, which guarantees that even if the program does not use the key, it will be considered strongly reachable until after reference-barrier returns.

procedure: reference-barrier object

Guarantee that object is strongly reachable until after reference-barrier returns.