For those of us at the old school, dynamic allocation is something expensive and optional! Data structures like this come naturally.
In more complex systems, you have to assume dynamic allocation and deallocation everywhere. And so you rarely encounter code that is this straightforward: these patterns are lost.
Reminds me of the original ls source code: I have it on my laptop somewhere. It doesn't really use generic dynamic allocation. It uses brk to get room at the end of the program for its scratch buffer.
A different world.
even in Rust they are just starting to get the concept of custom allocators, strings allocate on the heap by default. why can't I use per-frame arena allocators for strings in my immediate mode ui!? its all getting tossed at the end of the frame anyways.
at least zig has made custom allocators more of a first class thing... but this is why I keep coming back to C.
Thread collapsed