logoalt Hacker News

tliltocatl • yesterday at 7:27 AM • 3 replies • view on HN

When you need it, you need it for the whole program (including all the dependencies).


Replies

spacechild1 • yesterday at 9:43 AM

Not really. Case in point: (soft)realtime audio programming. If you need to allocate memory in the audio callback (or DSP helper threads), you must use a real-time safe allocator (bounded worst case, no mutexes). For the rest of the program you may still use the default system allocator.

LoganDark • yesterday at 8:03 AM

My toy kernel says otherwise. There are many stages of boot at varying levels of abstraction and being able to conveniently express each one is wonderful.

Also think of things like embedded scripting languages. Or having a special allocator for physics objects in a game as opposed to GUI objects. Yes, you can use a global allocator tuned to the workload. You can also tune allocators for each one. You don't have to, but you can.

➕ show 1 reply
slopinthebag • yesterday at 7:29 AM

rust has GlobalAlloc

➕ show 1 reply