A system I work on regularly has one calloc/free and one mmap/munmap left. Aside from those it's "statically allocated" meaning the entire life of the system takes place in a bunch of arrays of structs.
Yes quite a few structs have brands and pointers to them are branded as well. That's because it's possible for a reference you are holding to become invalid without you doing anything to it. Think "reference to a USB disk" and someone pulls the plug.
There's a duality here that I've been thinking about a lot lately. Anyone looking at memory allocation behavior would think this to be a REALLY boring system in which close to NOTHING ever happens.
Meanwhile it's pulling sensor data, processing queries from higher-level services, coordinating a network of micro controllers some of which come and go dynamically (and are identified dynamically), etc. It feels, in a way, like I built a custom kernel that runs under Linux as a process. Weird.
The concurrency aspects are also ... well you need to get used to it. There are a few threads that do things that could take "too long" for the main event loop. But those threads don't call into the rest of the system. They do their job and hold on to their data. And when it's convenient the event loop goes and picks up that data. That's where we find locks, but only there. I guess in a way it's "message passing" except that the messages are just "get" functions?
(Proudly self-plagiarized from several 2025 posts from my previous account.)