YoggieEngine/MemoryManager.h

18 lines
291 B
C
Raw Normal View History

#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);
}