Optimize: Reduce memory cost for tracking active allocations.
authorMilian Wolff <mail@milianw.de>
Mon, 7 Dec 2015 22:10:58 +0000 (23:10 +0100)
committerMilian Wolff <mail@milianw.de>
Mon, 7 Dec 2015 22:12:30 +0000 (23:12 +0100)
commit613cd167d80dd14cb5af2960b5a89e0ed60daf08
tree3db28dd2ba99d387a26bef67bacd52ba35ea1131
parenta3b20d36c8f77791e96f8e4b63a4493caa2cb4d0
Optimize: Reduce memory cost for tracking active allocations.

We split the hash into two, one for small allocations up to
numeric_limits<uint32_t>::max, and one for the bigger rest. This
allows us to reduce the cost by up to a factor of 2 for some apps.
A notable example here is heaptrack_gui itself, as it does tons of
small allocations for its lookup tables, which are long-lived.

In one test case this reduces the memory consumption of heaptrack by
up to 1GB for me.
accumulatedtracedata.cpp
accumulatedtracedata.h