3 ms·
Old discussion: https://news.ycombinator.com/item?id=9327526 https://news.ycombinator.com/item?id=9327526 And he forgot ptmalloc3, the improved version of the
by rurban 10y ago
Old discussion: https://news.ycombinator.com/item?id=9327526 https://news.ycombinator.com/item?id=9327526
And he forgot ptmalloc3, the improved version of the glibc malloc.
- teddyh 10y agoWho wrote ptmalloc3 – the original writer of ptmalloc2, or is it an independent creator who simply decided to call their fork “ptmalloc3”? In what way is it better? Why haven’t GNU libC converted to ptmalloc3?
- neopallium 10y agoptmalloc[0] is developed by Wolfram Gloger and is a modified version of Doug Lea's malloc (aka dlmalloc [1]). 0. http://www.malloc.de/en/ http://www.malloc.de/en/ 1. http://gee.cs.oswego.edu/pub/misc/malloc.c http://gee.cs.oswego.edu/pub/misc/malloc.c
- rurban 10y agoAd #1: yes, wolfram gloger. Ad #2: ptmalloc3 biggest advantage over dlmalloc 2.8.3 is for multiple threads, while trying to avoid lockcontention as much as possible. But it also has e.g. a better API to support slabs and array or struct elements via independent_comalloc(), which speeds up my compiled code by 20%. You can alloc your elements in once and still individually free them. See the malloc-2.8.3.h header: https://code.qt.io/cgit/qt/qt.git/tree/src/3rdparty/ptmalloc/malloc-2.8.3.h#n214 https://code.qt.io/cgit/qt/qt.git/tree/src/3rdparty/ptmalloc... Ad #3: memory usage. ptmalloc2 has the least overhead. In my case with lots of arrays which can be independent_comalloc'ed this is not observable.