TombEngine/TR5Main/Game/memory/malloc.cpp
Nils Gaitzsch 82b3944dde Deactivated Pool memory
@TODO: Fix Pool
Changed pointers for ChunkIds to smart pointers
2020-08-11 19:18:36 +02:00

26 lines
No EOL
442 B
C++

#include "framework.h"
#include "malloc.h"
#include "door.h"
#include "PoolAllocator.h"
using namespace T5M::Memory;
char* malloc_buffer;
int malloc_size;
char* malloc_ptr;
int malloc_free;
int malloc_used;
TGPool* gameMemory;
void init_game_malloc() noexcept
{
#if CUSTOM_MEMORY
gameMemory = new TGPool(8 * 1024 * 1024);
#endif
}
void game_free(void* ptr) noexcept
{
#if CUSTOM_MEMORY
gameMemory->free(ptr);
#else
delete[] ptr;
#endif
}