Skip to content

Commit 0ccec28

Browse files
committed
Moved reduction of allocations inside found block
1 parent aaa18c6 commit 0ccec28

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

tests/runtime_tests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ void operator delete(void* p) noexcept
3636
for (std::size_t i = 0; i < num_allocations; ++i) {
3737
if (allocations[i] == p) {
3838
std::swap(allocations[i], allocations[num_allocations-1]);
39+
--num_allocations;
3940
found = true;
4041
break;
4142
}
@@ -44,8 +45,6 @@ void operator delete(void* p) noexcept
4445
if (!found) {
4546
++double_delete;
4647
}
47-
48-
--num_allocations;
4948
}
5049

5150
std::free(p);

0 commit comments

Comments
 (0)