6 ms·
I would add: alloca() should be considered harmful and warned out of existence, like gets(). If your malloc() implementation is slow, fix that! tcmalloc and j
by loeg 8y ago
I would add: alloca() should be considered harmful and warned out of existence, like gets().
If your malloc() implementation is slow, fix that! tcmalloc and jemalloc have been around for a long time.
- dane-pgp 8y agoI'm reminded that the custom memory allocation system in OpenSSL was cited as being potentially implicated in the Heartbleed bug: https://www.darkreading.com/vulnerabilities---threats/did-a-faulty-memory-feature-lead-to-heartbleed/d/d-id/1204505 https://www.darkreading.com/vulnerabilities---threats/did-a-... or it at least made it harder for the code to be analysed by automated tools: https://dwheeler.com/essays/heartbleed.html#basic-fuzzers https://dwheeler.com/essays/heartbleed.html#basic-fuzzers
- loeg 8y agoI'm not sure if you're trying to compare OpenSSL's FIFO malloc cache to tcmalloc or jemalloc, or not. They have nothing in common. I was not proposing adding a crappy linked list cache in front of malloc(3), but instead linking a better malloc(3) implementation to your program (and gave specific, high-quality examples).