2 ms·
Writing a custom replacement for malloc is relatively common. You... can't be serious. That's common to you?
by zzalpha 9y ago
Writing a custom replacement for malloc is relatively common.
You... can't be serious. That's common to you?
- adrianN 9y agoYes? From the Wikipedia: "Because malloc and its relatives can have a strong impact on the performance of a program, it is not uncommon to override the functions for a specific application by custom implementations that are optimized for application's allocation patterns."
- zzalpha 9y ago"not uncommon" is far far from "common". If you're writing your own malloc replacement you're pretty deep into the weeds of high performance computing. Heck even just deciding to replace the stock implementation with an off-the-shelf replacement puts you in fairly rarified company. I'd wager the vast majority of software written for Linux makes use of the standard glibc allocator. I expect high performance games are the most common exception, but they represent a fraction of the C/C++ in the wild. Space leaks in Haskell, on the other hand, are unfortunately relatively easy to introduce.