YoggieEngine/BarinkEngine/Include/MemoryManager.h

18 lines
305 B
C++

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