Re:Understanding glibc malloc
by teddyh on Saturday July 02, 2016 @08:18PM
(#12024297)
Who 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?
[ Parent
| on HN ]
Ad #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...
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.
Re:Understanding glibc malloc
by neopallium on Sunday July 03, 2016 @12:32AM
(#12024827)
ptmalloc[0] is developed by Wolfram Gloger and is a modified version of Doug Lea's malloc (aka dlmalloc [1]).