That's actually a thing on real-time and/or latency-sensitive applications. Malloc has an unbounded worst-case execution time, which is fundamentally incompatible with real-time design and can also cause jitter.
So in those systems, you either use only static memory and stack allocations, or indeed allocate a large enough pool what you might need ahead of time and use a memory manager that does follow your timings to manage memory within it.
View all comments
Show parent comment
54
u/WriterPlastic9350 Oct 10 '26
Real Programmers manually allocate all their memory ahead of time. :^)
(technically I suppose there's nothing stopping you doing this with your own implementation of malloc)