> Hum, the point of PyMem_Malloc() is that it's distinct from PyObject_Malloc(), right? Why would you redirect one to the other?
For performances.
> (of course, we might question why we have two different families of allocation APIs...)
That's the real question: why does Python have PyMem family? Is it still justified in 2016?
--
Firefox uses jemalloc to limit the fragmentation of the heap memory. Once I spent a lot of time to try to understand the principle of fragmentation, and in my tiny benchmarks, jemalloc was *much* better than system allocator. By the way, jemalloc scales well on multiple threads ;-)
* http://www.canonware.com/jemalloc/
* https://github.com/jemalloc/jemalloc/wiki
My notes on heap memory fragmentation: http://haypo-notes.readthedocs.org/heap_fragmentation.html |