@@ -44,7 +44,6 @@ std::atomic<size_t> indexAllocation(0);
44
44
std::atomic<size_t > indexDeallocation (0 );
45
45
bool logTraces = false ;
46
46
int fastLeakDetectionMode = 0 ;
47
- bool memsetNewAllocations = false ;
48
47
49
48
AllocationEvent eventsAllocated[maxEvents];
50
49
AllocationEvent eventsDeallocated[maxEvents];
@@ -246,40 +245,23 @@ using MemoryManagement::allocate;
246
245
using MemoryManagement::AllocationEvent;
247
246
using MemoryManagement::deallocate;
248
247
249
- NO_SANITIZE
250
- inline void initMemory (void *p, size_t size) {
251
- if ((p == nullptr ) || (false == MemoryManagement::memsetNewAllocations)) {
252
- return ;
253
- }
254
-
255
- memset (p, 0 , size);
256
- }
257
-
258
248
#if defined(_WIN32)
259
249
#pragma warning(disable : 4290)
260
250
#endif
261
251
void *operator new (size_t size) {
262
- void *p = allocate<AllocationEvent::EVENT_NEW, AllocationEvent::EVENT_NEW_FAIL>(size);
263
- initMemory (p, size);
264
- return p;
252
+ return allocate<AllocationEvent::EVENT_NEW, AllocationEvent::EVENT_NEW_FAIL>(size);
265
253
}
266
254
267
255
void *operator new (size_t size, const std::nothrow_t &) noexcept {
268
- void *p = allocate<AllocationEvent::EVENT_NEW_NOTHROW, AllocationEvent::EVENT_NEW_NOTHROW_FAIL>(size, std::nothrow);
269
- initMemory (p, size);
270
- return p;
256
+ return allocate<AllocationEvent::EVENT_NEW_NOTHROW, AllocationEvent::EVENT_NEW_NOTHROW_FAIL>(size, std::nothrow);
271
257
}
272
258
273
259
void *operator new [](size_t size) {
274
- void *p = allocate<AllocationEvent::EVENT_NEW_ARRAY, AllocationEvent::EVENT_NEW_ARRAY_FAIL>(size);
275
- initMemory (p, size);
276
- return p;
260
+ return allocate<AllocationEvent::EVENT_NEW_ARRAY, AllocationEvent::EVENT_NEW_ARRAY_FAIL>(size);
277
261
}
278
262
279
263
void *operator new [](size_t size, const std::nothrow_t &t) noexcept {
280
- void *p = allocate<AllocationEvent::EVENT_NEW_ARRAY_NOTHROW, AllocationEvent::EVENT_NEW_ARRAY_NOTHROW_FAIL>(size, std::nothrow);
281
- initMemory (p, size);
282
- return p;
264
+ return allocate<AllocationEvent::EVENT_NEW_ARRAY_NOTHROW, AllocationEvent::EVENT_NEW_ARRAY_NOTHROW_FAIL>(size, std::nothrow);
283
265
}
284
266
285
267
void operator delete (void *p) noexcept {
0 commit comments