Super Mario 64 Source
A Super Mario 64 decompilation, brought to you by a bunch of clever folks.
Data Structures | Macros | Enumerations | Functions
gd_memory.h File Reference
#include <ultra64.h>

Go to the source code of this file.

Data Structures

struct  GMemBlock
 A structure that holds information about memory allocation on goddard's heap. More...
 

Macros

#define PERM_G_MEM_BLOCK   0xF0
 
#define TEMP_G_MEM_BLOCK   0x0F
 

Enumerations

enum  GMemBlockTypes { G_MEM_BLOCK_FREE = 1, G_MEM_BLOCK_USED = 2 }
 Block list types for GMemBlock.blockType. More...
 

Functions

u32 gd_free_mem (void *)
 Free memory allocated on the goddard heap. More...
 
voidgd_request_mem (u32, u8)
 Request a pointer to goddard heap memory of at least size and of the same permanence. More...
 
struct GMemBlockgd_add_mem_to_heap (u32, u32, u8)
 Add memory of size at addr to the goddard heap for later allocation. More...
 
void init_mem_block_lists (void)
 NULL the various GMemBlock list heads. More...
 
void mem_stats (void)
 Print summary information about all used, free, and empty GMemBlocks. More...
 

Macro Definition Documentation

◆ PERM_G_MEM_BLOCK

#define PERM_G_MEM_BLOCK   0xF0

◆ TEMP_G_MEM_BLOCK

#define TEMP_G_MEM_BLOCK   0x0F

Enumeration Type Documentation

◆ GMemBlockTypes

Block list types for GMemBlock.blockType.

Note that Empty Blocks don't have a specific value.

Enumerator
G_MEM_BLOCK_FREE 
G_MEM_BLOCK_USED 

Function Documentation

◆ gd_add_mem_to_heap()

struct GMemBlock* gd_add_mem_to_heap ( u32  size,
u32  addr,
u8  permanence 
)

Add memory of size at addr to the goddard heap for later allocation.

Returns
GMemBlock that contains info about the new heap memory

◆ gd_free_mem()

u32 gd_free_mem ( void ptr)

Free memory allocated on the goddard heap.

Parameters
ptrpointer to heap allocated memory
Returns
size of memory freed
Return values
0ptr did not point to a valid memory block

◆ gd_request_mem()

void* gd_request_mem ( u32  size,
u8  permanence 
)

Request a pointer to goddard heap memory of at least size and of the same permanence.

Returns
pointer to heap
Return values
NULLcould not fulfill the request

◆ init_mem_block_lists()

void init_mem_block_lists ( void  )

NULL the various GMemBlock list heads.

◆ mem_stats()

void mem_stats ( void  )

Print summary information about all used, free, and empty GMemBlocks.