18 lines
291 B
C++
18 lines
291 B
C++
#pragma once
|
|
#include <iostream>
|
|
#include <stdlib.h>
|
|
|
|
static int HeapAllocations = 0;
|
|
static int HeapDeallocations = 0;
|
|
|
|
void* operator new(std::size_t sz) {
|
|
HeapAllocations++;
|
|
return std::malloc(sz);
|
|
}
|
|
|
|
void operator delete(void* ptr) noexcept {
|
|
HeapDeallocations++;
|
|
std::free(ptr);
|
|
}
|
|
|