Skip to content
Snippets Groups Projects
Commit b211cf4b authored by Nadav Har'El's avatar Nadav Har'El
Browse files

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 ;-)
parent de374193
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment