2D_Game_Engine
Loading...
Searching...
No Matches
memory.cpp
Go to the documentation of this file.
1#include <pch.hpp>
2
3void *AllocateMemory(size_t size,std::source_location src){
4 #ifdef DEBUG
5 printf("Allocating %zu bytes from %s:%d\n",size,src.file_name(),src.line());
6 #endif
7 void *ptr=operator new(size);
8 return ptr;
9}
10
11void FreeMemory(void *ptr,std::source_location src){
12 #ifdef DEBUG
13 printf("Freeing memory from %s:%d\n",src.file_name(),src.line());
14 #endif
15 if(ptr!=nullptr)
16 operator delete(ptr);
17}
void FreeMemory(void *ptr, std::source_location src)
Definition memory.cpp:11
void * AllocateMemory(size_t size, std::source_location src)
Definition memory.cpp:3