diff --git a/unit_tests/helpers/memory_management.cpp b/unit_tests/helpers/memory_management.cpp index 85ad0ee702..a007d95d3f 100644 --- a/unit_tests/helpers/memory_management.cpp +++ b/unit_tests/helpers/memory_management.cpp @@ -44,7 +44,6 @@ std::atomic indexAllocation(0); std::atomic indexDeallocation(0); bool logTraces = false; int fastLeakDetectionMode = 0; -bool memsetNewAllocations = false; AllocationEvent eventsAllocated[maxEvents]; AllocationEvent eventsDeallocated[maxEvents]; @@ -246,40 +245,23 @@ using MemoryManagement::allocate; using MemoryManagement::AllocationEvent; using MemoryManagement::deallocate; -NO_SANITIZE -inline void initMemory(void *p, size_t size) { - if ((p == nullptr) || (false == MemoryManagement::memsetNewAllocations)) { - return; - } - - memset(p, 0, size); -} - #if defined(_WIN32) #pragma warning(disable : 4290) #endif void *operator new(size_t size) { - void *p = allocate(size); - initMemory(p, size); - return p; + return allocate(size); } void *operator new(size_t size, const std::nothrow_t &) noexcept { - void *p = allocate(size, std::nothrow); - initMemory(p, size); - return p; + return allocate(size, std::nothrow); } void *operator new[](size_t size) { - void *p = allocate(size); - initMemory(p, size); - return p; + return allocate(size); } void *operator new[](size_t size, const std::nothrow_t &t) noexcept { - void *p = allocate(size, std::nothrow); - initMemory(p, size); - return p; + return allocate(size, std::nothrow); } void operator delete(void *p) noexcept {