3 ms·
I do the related small allocations from the pools, and the pools are destroyed at every compilation end. If the pool element is for example 32K and the average
by acqq 13y ago
I do the related small allocations from the pools, and the pools are destroyed at every compilation end. If the pool element is for example 32K and the average element is e.g. 32 bytes that's 1K times less "real" mallocs. Having separate pools for the members of different "structures" also makes for better CPU cache usage.
Edit: as aaronblohowiak writes, this method is commonly known as a http://en.wikipedia.org/wiki/Region-based_memory_management http://en.wikipedia.org/wiki/Region-based_memory_management