News for hackers. Stuff that matters.
Re:In C, how do you know if the dynamic allocation succeeded? by stefan_ on Friday November 05, 2021 @04:20PM (#29124319)
Embedded systems (the ones where you would disallow malloc) don't generally have virtual memory by virtue of having no MMU, so on those you can't do overcommitment since there is no page fault mechanism.

No, the reason is simply that by statically allocating all memory you can avoid entire classes of program faults and bugs. There are no memory leaks and you don't need to solve the NP-complete problem of "is there an execution path where a dynamic memory allocation will fail". Keep in mind that it is not just about the total amount of dynamically allocated memory, but also the order of allocations (and frees).

There are no comments on this comment yet.