3 ms·
Fair enough, but it's a good bet that most of those mallocs cannot be replaced with stack allocations.
by eridius 10y ago
Fair enough, but it's a good bet that most of those mallocs cannot be replaced with stack allocations.
- MaulingMonkey 10y agoSo grab an fixed-size pool allocator. Malloc is very generic, and faster alternatives aren't limited to stack allocators. EDIT: Or do what the article does, eliminate allocations that were straight up unnecessary (because they were unused, or over-eager deep copies)
- nnethercote 10y agoMy post indicates that I've already removed a large chunk of the existing mallocs. The remaining ones are harder, but I expect I'll be able to still remove a decent fraction.