* THA docs

Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>

* format

* namefixer

* yada

* remove zero pad comment

* Update include/z64.h

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* Update include/thga.h

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* namefixer

* bss

* namefixer

---------

Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>
Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
This commit is contained in:
Anghelo Carvajal
2023-03-24 14:38:04 -03:00
committed by GitHub
parent f3d2c56d1d
commit 147e4fcedc
28 changed files with 321 additions and 187 deletions
+8 -8
View File
@@ -158,11 +158,11 @@ void GameState_InitArena(GameState* gameState, size_t size) {
void* buf = GameAlloc_Malloc(alloc, size);
if (buf) {
THA_Ct(&gameState->heap, buf, size);
THA_Init(&gameState->heap, buf, size);
return;
}
THA_Ct(&gameState->heap, NULL, 0);
THA_Init(&gameState->heap, NULL, 0);
__assert("../game.c", 1035);
}
@@ -174,9 +174,9 @@ void GameState_Realloc(GameState* gameState, size_t size) {
size_t bytesAllocated;
void* heapStart;
heapStart = gameState->heap.bufp;
heapStart = gameState->heap.start;
alloc = &gameState->alloc;
THA_Dt(&gameState->heap);
THA_Destroy(&gameState->heap);
GameAlloc_Free(alloc, heapStart);
SystemArena_GetSizes(&systemMaxFree, &bytesFree, &bytesAllocated);
size = ((systemMaxFree - (sizeof(ArenaNode))) < size) ? (0) : (size);
@@ -185,9 +185,9 @@ void GameState_Realloc(GameState* gameState, size_t size) {
}
if ((gameArena = GameAlloc_Malloc(alloc, size)) != NULL) {
THA_Ct(&gameState->heap, gameArena, size);
THA_Init(&gameState->heap, gameArena, size);
} else {
THA_Ct(&gameState->heap, 0, 0);
THA_Init(&gameState->heap, 0, 0);
__assert("../game.c", 1074);
}
}
@@ -240,7 +240,7 @@ void GameState_Destroy(GameState* gameState) {
func_801420F4(&D_801F8020);
VisMono_Destroy(&sMonoColors);
func_80140900(&D_801F8048);
THA_Dt(&gameState->heap);
THA_Destroy(&gameState->heap);
GameAlloc_Cleanup(&gameState->alloc);
}
@@ -257,7 +257,7 @@ u32 GameState_IsRunning(GameState* gameState) {
}
s32 GameState_GetArenaSize(GameState* gameState) {
return THA_GetSize(&gameState->heap);
return THA_GetRemaining(&gameState->heap);
}
s32 func_80173B48(GameState* gameState) {