Because you could implement forget
with an Rc
cycle. The choices were:
Rc
and Arc
would be unsafe; orThere are no other possibilities. Really, the third option was the only sane choice.
In practice there are more ways of in practice leaking memory (that is: it’s not leak-leaked, as it’s still reachable, but for practical purposes it’s leaked because nothing’s ever going to actually reach it), such as spawning a thread that just goes to sleep and sits on it forever, or just leaving it somewhere that won’t be freed.