3 ms·
Writing a custom replacement for malloc is relatively common. Does that count?
by adrianN 10y ago
Writing a custom replacement for malloc is relatively common. Does that count?
- zzalpha 10y agoWriting a custom replacement for malloc is relatively common. You... can't be serious. That's common to you?
- adrianN 10y 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 10y 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.
- Veedrac 10y agoI don't see why not, though I wouldn't consider that to be an example of a difficult to diagnose problem in the same vein as lazy evaluation.