3 ms·
The parent post was talking about using malloc once at the start of the program, are you talking about defining that with your linker script? Also if the goal
by CyberDildonics 8y ago
The parent post was talking about using malloc once at the start of the program, are you talking about defining that with your linker script?
Also if the goal is to get one chunk of memory with a single call, why use malloc at all? Why not use the direct memory mapping command?
- monocasa 8y agoI don't think he's talking about using malloc "once", he's talking about only using it during init. In practice you end calling it a bunch in that model, the last design I shipped like that ended up making a few hundred malloc (well new operator because this was C++) calls at init. Under that system malloc/new was just a pointer bump, and an assert if there wasn't enough room. Free wasn't linked, and delete asserted. That heap region (or mine had several heaps that lived in different memory with different characteristics that could be specified with a new overload) is way easier to define in your linker.