So, something that happens in my life is that I'll be on some kind of kick, and end up separately talking about it in several distant corners of my social space independently and redundantly. Lately, that's been the war I'd like to someday wage against general-purpose allocators. Well, guess what just coincidentally happened across my recommended feed today?
Parts of this will feel remedial to experts, since Nic is doing something that I do a lot (attempt to write for a wide audience and train people up in better patterns than the mainstream), but if you're already a low-level programmer, the thing to pay attention to is the philosophy here. `malloc` (and its wrappers, like C++ new or smart pointers, default allocation in Rust) is a general-purpose allocator, and those are... inherently, jacks-of-all-trades, which leads to several problems of lifetime complexity and runtime cycle use.
(or, in more incendiary terms: death to `malloc`!)
Memory Management, Explained Simply (Part 1)
YouTube
@MaddieM4 One of the things that I discovered when digging into the internals of shader compilers is that they all (well, glslang and Mesa at least) use custom allocators because they have specific object lifecycles, so you really want the ability to slowly build up a complicated tangle of objects that all point to each other and then when you're done compiling just discard all of them in one go.