![]() |
Jo Engine 2026.11.1
Jo Sega Saturn Engine
|
Jo Engine Malloc. More...
Go to the source code of this file.
Macros | |
| #define | JO_MALLOC_MAX_MEMORY_ZONE |
| Define the total of memory zone available through jo_add_memory_zone(). | |
Enumerations | |
| enum | jo_extended_ram_cartridge_type { CART_NONE , CART_8MBits , CART_32MBits } |
| Extended RAM cartridge type. More... | |
| enum | jo_malloc_behaviour { JO_FAST_ALLOCATION , JO_MALLOC_TRY_REUSE_BLOCK , JO_MALLOC_TRY_REUSE_SAME_BLOCK_SIZE } |
| Malloc behaviour JO_MALLOC_TRY_REUSE_SAME_BLOCK_SIZE | ^ | | Speed efficiency | | V | JO_MALLOC_TRY_REUSE_BLOCK | ^ | | Speed efficiency | | V | JO_FAST_ALLOCATION. More... | |
Functions | |
| void * | jo_malloc_with_behaviour (unsigned int n, const jo_malloc_behaviour behaviour) |
| dynamic memory allocator with specific behaviour | |
| static __jo_force_inline void * | jo_malloc (unsigned int n) |
| dynamic memory allocator | |
| void | jo_free (const void *const p) |
| function frees the memory space pointed to by p | |
| void | jo_reduce_memory_fragmentation (void) |
| Reduce memory fragmentation for faster memory allocation. | |
| void | jo_add_memory_zone (unsigned char *ptr, const unsigned int size_in_bytes) |
| Register a memory segment for jo_malloc() usage. | |
| int | jo_memory_usage_percent (void) |
| Get memory usage percent. | |
| int | jo_memory_fragmentation (void) |
| Get memory fragmentation (Number of fragment in memory). | |
Jo Engine Malloc.
| #define JO_MALLOC_MAX_MEMORY_ZONE |
Define the total of memory zone available through jo_add_memory_zone().
| enum jo_malloc_behaviour |
Malloc behaviour JO_MALLOC_TRY_REUSE_SAME_BLOCK_SIZE | ^ | | Speed efficiency | | V | JO_MALLOC_TRY_REUSE_BLOCK | ^ | | Speed efficiency | | V | JO_FAST_ALLOCATION.
| void jo_add_memory_zone | ( | unsigned char * | ptr, |
| const unsigned int | size_in_bytes ) |
Register a memory segment for jo_malloc() usage.
| ptr | Pointer to the beginning of the memory segment |
| size_in_bytes | Size of the memory segment in bytes |
| void jo_free | ( | const void *const | p | ) |
function frees the memory space pointed to by p
| p | pointer that must have been returned by a previous call to jo_malloc() |
|
static |
dynamic memory allocator
| n | Segment size |
| void * jo_malloc_with_behaviour | ( | unsigned int | n, |
| const jo_malloc_behaviour | behaviour ) |
dynamic memory allocator with specific behaviour
| n | Segment size |
| behaviour | Allocation Behaviour |
| int jo_memory_fragmentation | ( | void | ) |
Get memory fragmentation (Number of fragment in memory).
| int jo_memory_usage_percent | ( | void | ) |
Get memory usage percent.
| void jo_reduce_memory_fragmentation | ( | void | ) |
Reduce memory fragmentation for faster memory allocation.