-
- Downloads
Don't waste time tracking allocations inside allocations
When the allocation tracking code itself does allocations, we do not track these allocations - and we notice this by the "depth" of the alloc_tracker mutex. This avoids some messy infinite recursion, and also improves performance because alloc_tracker does do a bunch of allocations (most of them not apparent from the code), and tracking them too would significantly slow it down, with no benefit because we're not debugging the allocation tracker itself. But while the existing code ignored nested alloc_tracker::remember(), we forgot to also ignore nested alloc_tracker::forget()! This meant that for each allocation inside alloc_tracker, we never tracked it, but wasted our time trying to delete it from the list of living allocations. This oversight caused a huge slowdown of alloc_tracker(), which this patch fixes. alloc_tracker() is now just very slow, not very very very slow ;-)
Loading
Please register or sign in to comment