KallistiOS git master
Independent SDK for the Sega Dreamcast
|
Memory management API for VRAM More...
Functions | |
pvr_ptr_t | pvr_mem_malloc (size_t size) |
Allocate a chunk of memory from texture space. | |
void | pvr_mem_free (pvr_ptr_t chunk) |
Free a block of allocated memory in the PVR RAM pool. | |
uint32_t | pvr_mem_available (void) |
Return the number of bytes available still in the PVR RAM pool. | |
void | pvr_mem_reset (void) |
Reset the PVR RAM pool. | |
void | pvr_mem_print_list (void) |
Print the list of allocated blocks in the PVR RAM pool. | |
void | pvr_mem_stats (void) |
Print statistics about the PVR RAM pool. | |
Memory management API for VRAM
PVR memory management in KOS uses a modified dlmalloc; see the source file pvr_mem_core.c for more info.
uint32_t pvr_mem_available | ( | void | ) |
Return the number of bytes available still in the PVR RAM pool.
void pvr_mem_free | ( | pvr_ptr_t | chunk | ) |
Free a block of allocated memory in the PVR RAM pool.
This function frees memory previously allocated with pvr_mem_malloc().
chunk | The location of the start of the block to free |
pvr_ptr_t pvr_mem_malloc | ( | size_t | size | ) |
Allocate a chunk of memory from texture space.
This function acts as the memory allocator for the PVR texture RAM pool. It acts exactly as one would expect a malloc() function to act, returning a normal pointer that can be directly written to if one desires to do so. All allocations will be aligned to a 32-byte boundary.
size | The amount of memory to allocate |
void pvr_mem_print_list | ( | void | ) |
Print the list of allocated blocks in the PVR RAM pool.
This function only works if you've enabled KM_DBG in pvr_mem.c.
void pvr_mem_reset | ( | void | ) |
Reset the PVR RAM pool.
This will essentially free any blocks allocated within the pool. There's generally not many good reasons for doing this.
void pvr_mem_stats | ( | void | ) |
Print statistics about the PVR RAM pool.
This prints out statistics like what malloc_stats() provides. Also, if KM_DBG is enabled in pvr_mem.c, it prints the list of allocated blocks.