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

Add forgotten break

In the allocation tracker, not only did I use a dog-slow linear search,
I forgot to stop on the first empty spot, and actually used the last
empty spot... Add the missing break, which made leak detection 10% faster.

A better implementation would be preferable, but this is a low hanging
fruit
parent 5e426786
No related branches found
No related tags found
No related merge requests found
...@@ -23,6 +23,7 @@ void alloc_tracker::remember(void *addr, int size) ...@@ -23,6 +23,7 @@ void alloc_tracker::remember(void *addr, int size)
if(!allocations[i].addr){ if(!allocations[i].addr){
// found a free spot, reuse it // found a free spot, reuse it
a = &allocations[i]; a = &allocations[i];
break;
} }
} }
if (!a) { if (!a) {
......
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