Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

reference cycle

Values that point to each other with counted references, so none of them is ever freed.

Rc values that own each other keep their strong counts above zero forever; the memory leaks (safely). Weak references, which don't count as owners, break the cycle.

Loading interactive…

Examples

  • If node a holds an Rc to b and b holds one back to a, dropping both variables leaves each count at 1, so neither node is ever freed.

Read the full section →