1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-02-27 03:24:45 +00:00
oot/include/gamealloc.h
mzxrules 981af4b6af
Reduce overlay dependencies on global.h (8) (#2478)
* move variables into z64environment.h

* z_room.h

* z64sram.h, z64ss_sram.h, z64font.h, kanread.h

* z64lifemeter.h, z64debug.h, debug_arena.h

* buffers.h

* remove z_bgcheck global

* gamealloc.h

* suggestions

* .bdd
2025-02-19 05:54:39 -05:00

31 lines
894 B
C

#ifndef GAMEALLOC_H
#define GAMEALLOC_H
#include "ultra64/ultratypes.h"
typedef struct GameAllocEntry {
/* 0x00 */ struct GameAllocEntry* next;
/* 0x04 */ struct GameAllocEntry* prev;
/* 0x08 */ u32 size;
/* 0x0C */ u32 unk_0C;
} GameAllocEntry; // size = 0x10
typedef struct GameAlloc {
/* 0x00 */ GameAllocEntry base;
/* 0x10 */ GameAllocEntry* head;
} GameAlloc; // size = 0x14
#if DEBUG_FEATURES
#define GAME_ALLOC_MALLOC(alloc, size, file, line) GameAlloc_MallocDebug(alloc, size, file, line)
void* GameAlloc_MallocDebug(GameAlloc* this, u32 size, const char* file, int line);
#else
#define GAME_ALLOC_MALLOC(alloc, size, file, line) GameAlloc_Malloc(alloc, size)
#endif
void* GameAlloc_Malloc(GameAlloc* this, u32 size);
void GameAlloc_Free(GameAlloc* this, void* data);
void GameAlloc_Cleanup(GameAlloc* this);
void GameAlloc_Init(GameAlloc* this);
#endif