Robert Nystrom wrote up a sharp walkthrough to build a simple mark and sweep
garbage collector in C. I think it’s a great place to start wrapping
your mind around the game of illusions we call memory management.
Why read this in the day and age of ARC, you ask? History is important,
and the shallows of monoculture spoil the mind. Besides, you’d miss out on
quips like this:
It was invented by John McCarthy, the man who invented Lisp and beards, so
you implementing it now is like communing with one of the Elder Gods, but
hopefully not in some Lovecraftian way that ends with you having your mind
and retinas blasted clean.
(Via Aaron Brethorst)