#ifndef GD_MEMORY_H1#define GD_MEMORY_H23#include <PR/ultratypes.h>45/// A structure that holds information about memory allocation on goddard's heap.6struct GMemBlock {7/* 0x00 */ u8 *ptr;8/* 0x04 */ u32 size;9/* 0x08 */ u8 blockType;10/* 0x09 */ u8 permFlag; ///< Permanent (upper four bits) or Temporary (lower four bits)11/* 0x0C */ struct GMemBlock *next;12/* 0x10 */ struct GMemBlock *prev;13};1415/// Block list types for `GMemBlock.blockType`. Note that Empty Blocks don't have16/// a specific value.17enum GMemBlockTypes {18G_MEM_BLOCK_FREE = 1,19G_MEM_BLOCK_USED = 220};21/* Block Permanence Defines */22/* This may be collections of certain allocation types23* eg. 0x10 = Object; 0x20 = Color Buffer; 0x40 = Z Buf; 0x01 = basic; etc. */24#define PERM_G_MEM_BLOCK 0xF025#define TEMP_G_MEM_BLOCK 0x0F2627// functions28extern u32 gd_free_mem(void *ptr);29extern void *gd_request_mem(u32 size, u8 permanence);30extern struct GMemBlock *gd_add_mem_to_heap(u32 size, void *addr, u8 permanence);31extern void init_mem_block_lists(void);32extern void mem_stats(void);3334#endif // GD_MEMORY_H353637