35#ifndef __JO_MALLOC_H__
36# define __JO_MALLOC_H__
42#define JO_MALLOC_MAX_MEMORY_ZONE (9)
113#ifdef JO_COMPILE_WITH_RAM_CARD_SUPPORT
int jo_memory_usage_percent(void)
Get memory usage percent.
void jo_reduce_memory_fragmentation(void)
Reduce memory fragmentation for faster memory allocation.
int jo_memory_fragmentation(void)
Get memory fragmentation (Number of fragment in memory).
static __jo_force_inline void * jo_malloc(unsigned int n)
dynamic memory allocator
Definition malloc.h:91
void jo_free(const void *const p)
function frees the memory space pointed to by p
jo_extended_ram_cartridge_type
Extended RAM cartridge type.
Definition malloc.h:46
@ CART_32MBits
4 Mb cartridge
Definition malloc.h:52
@ CART_8MBits
1 Mb cartridge
Definition malloc.h:50
@ CART_NONE
No cartridge.
Definition malloc.h:48
void * jo_malloc_with_behaviour(unsigned int n, const jo_malloc_behaviour behaviour)
dynamic memory allocator with specific behaviour
jo_malloc_behaviour
Malloc behaviour JO_MALLOC_TRY_REUSE_SAME_BLOCK_SIZE | ^ | | Speed efficiency | | V | JO_MALLOC_TRY_R...
Definition malloc.h:71
@ JO_MALLOC_TRY_REUSE_SAME_BLOCK_SIZE
A little bit slower than JO_MALLOC_TRY_REUSE_BLOCK but reduce memory usage.
Definition malloc.h:77
@ JO_MALLOC_TRY_REUSE_BLOCK
A little bit slower but reduce memory fragmentation.
Definition malloc.h:75
@ JO_FAST_ALLOCATION
Default behaviour.
Definition malloc.h:73
void jo_add_memory_zone(unsigned char *ptr, const unsigned int size_in_bytes)
Register a memory segment for jo_malloc() usage.
#define JO_RAM_CARTRIDGE_ID_32MBITS
Extended RAM cartridge identifier: 4 MB (32 Mbits).
Definition sega_saturn.h:442
#define JO_RAM_CARTRIDGE_ID_8MBITS
Extended RAM cartridge identifier: 1 MB (8 Mbits).
Definition sega_saturn.h:440
#define JO_RAM_CARTRIDGE_ID
Extended RAM cartridge identifier.
Definition sega_saturn.h:438
#define __jo_force_inline
force inline attribute (and prevent Doxygen prototype parsing bug)
Definition types.h:39