KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
Allocator Extensions

KOS custom allocator extensions More...

Files

file  malloc.h
 KOS-specific Allocator functionality.
 

Macros

#define DEFAULT_MXFAST   64
 
#define DEFAULT_TRIM_THRESHOLD   (256*1024)
 
#define DEFAULT_TOP_PAD   0
 
#define DEFAULT_MMAP_THRESHOLD   (256*1024)
 
#define DEFAULT_MMAP_MAX   65536
 

Functions

int malloc_irq_safe (void)
 Determine if it is safe to call malloc() in an IRQ context.
 
int mem_check_block (void *p)
 Only available with KM_DBG.
 
int mem_check_all (void)
 Only available with KM_DBG.
 

Detailed Description

KOS custom allocator extensions

Macro Definition Documentation

◆ DEFAULT_MMAP_MAX

#define DEFAULT_MMAP_MAX   65536

◆ DEFAULT_MMAP_THRESHOLD

#define DEFAULT_MMAP_THRESHOLD   (256*1024)

◆ DEFAULT_MXFAST

#define DEFAULT_MXFAST   64

◆ DEFAULT_TOP_PAD

#define DEFAULT_TOP_PAD   0

◆ DEFAULT_TRIM_THRESHOLD

#define DEFAULT_TRIM_THRESHOLD   (256*1024)

Function Documentation

◆ malloc_irq_safe()

int malloc_irq_safe ( void )

Determine if it is safe to call malloc() in an IRQ context.

This function checks the value of the internal spinlock that is used for malloc() to ensure that a call to it will not freeze the running process. This is only really useful in an IRQ context to ensure that a call to malloc() (or some other memory allocation function) won't cause a deadlock.

Return values
1If it is safe to call malloc() in the current IRQ.
0Otherwise.

◆ mem_check_all()

int mem_check_all ( void )

Only available with KM_DBG.

◆ mem_check_block()

int mem_check_block ( void * p)

Only available with KM_DBG.