Next: Will Executors Up: Memory Management Previous: Memory Management

# Weak Boxes

A weak box is similar to a normal box (see section 4.9), but when the automatic memory manager can prove that the content value of a weak box is only reachable via weak boxes, the content of the weak box is replaced with `#f`.

- `(make-weak-box v)` returns a new weak box that initially contains v.
- `(weak-box-value weak-box)` returns the value contained in weak-box. If the memory manager has proven that the previous content value of weak-box was reachable only through weak boxes, then `#f` is returned.
- `(weak-box? v)` returns `#t` if v is a weak box, `#f` otherwise.