We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b4d1be3 commit b88e8edCopy full SHA for b88e8ed
tests/runtime_tests.cpp
@@ -6,7 +6,7 @@
6
#include <vector>
7
8
// Allocation tracker, to catch memory leaks and double delete
9
-constexpr std::size_t max_allocations = 200'000;
+constexpr std::size_t max_allocations = 20'000;
10
void* allocations[max_allocations];
11
void* allocations_array[max_allocations];
12
std::size_t num_allocations = 0u;
@@ -45,6 +45,10 @@ void* allocate(std::size_t size, bool array) {
45
}
46
47
void deallocate(void* p, bool array) {
48
+ if (p == nullptr) {
49
+ return;
50
+ }
51
+
52
if (memory_tracking) {
53
bool found = false;
54
void** allocations_type = array ? allocations_array : allocations;
0 commit comments