2022-05-27 20:47:36 +00:00
|
|
|
#pragma once
|
|
|
|
#include <iostream>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
static int HeapAllocations = 0;
|
|
|
|
static int HeapDeallocations = 0;
|
|
|
|
|
2022-05-28 11:32:17 +00:00
|
|
|
inline void* operator new(std::size_t sz) {
|
2022-05-27 20:47:36 +00:00
|
|
|
HeapAllocations++;
|
|
|
|
return std::malloc(sz);
|
|
|
|
}
|
|
|
|
|
2022-05-28 11:32:17 +00:00
|
|
|
inline void operator delete(void* ptr) noexcept {
|
2022-05-27 20:47:36 +00:00
|
|
|
HeapDeallocations++;
|
|
|
|
std::free(ptr);
|
|
|
|
}
|
|
|
|
|