fallout2-ce/src/game_memory.cc

40 lines
857 B
C++
Raw Normal View History

2022-05-19 01:51:26 -07:00
#include "game_memory.h"
#include "db.h"
#include "dictionary.h"
#include "memory.h"
2022-06-18 06:47:23 -07:00
#include "memory_defs.h"
2022-05-19 01:51:26 -07:00
#include "memory_manager.h"
2022-06-18 06:47:23 -07:00
static void* gameMemoryMalloc(size_t size);
static void* gameMemoryRealloc(void* ptr, size_t newSize);
static void gameMemoryFree(void* ptr);
2022-05-19 01:51:26 -07:00
// 0x44B250
int gameMemoryInit()
{
dictionarySetMemoryProcs(internal_malloc, internal_realloc, internal_free);
_db_register_mem(internal_malloc, internal_strdup, internal_free);
memoryManagerSetProcs(gameMemoryMalloc, gameMemoryRealloc, gameMemoryFree);
return 0;
}
// 0x44B294
2022-06-18 06:47:23 -07:00
static void* gameMemoryMalloc(size_t size)
2022-05-19 01:51:26 -07:00
{
return internal_malloc(size);
}
// 0x44B29C
2022-06-18 06:47:23 -07:00
static void* gameMemoryRealloc(void* ptr, size_t newSize)
2022-05-19 01:51:26 -07:00
{
return internal_realloc(ptr, newSize);
}
// 0x44B2A4
2022-06-18 06:47:23 -07:00
static void gameMemoryFree(void* ptr)
2022-05-19 01:51:26 -07:00
{
internal_free(ptr);
}