LibXenon
Bare-metal Xbox 360 homebrew library
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
lib_malloc.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  memstats_s
 
struct  memnode_s
 
struct  mempool_s
 

Macros

#define KMEMINIT(buffer, length)   kmeminit(&kmempool,(buffer),(length))
 
#define KMEMPOOLBASE()   kmempoolbase(&kmempool)
 
#define KMEMPOOLSIZE()   kmempoolsize(&kmempool)
 
#define KMALLOC(size, align)   kmalloc(&kmempool,(size),(align))
 
#define KFREE(ptr)   kfree(&kmempool,(ptr))
 
#define KMEMSTATS(s)   kmemstats(&kmempool,(s))
 

Typedefs

typedef struct memstats_s memstats_t
 
typedef struct memnode_s memnode_t
 
typedef struct mempool_s mempool_t
 

Enumerations

enum  memnode_status_t { memnode_free = 0 , memnode_alloc }
 

Functions

void kmeminit (mempool_t *pool, unsigned char *buffer, int length)
 
void kfree (mempool_t *pool, void *ptr)
 
void * kmalloc (mempool_t *pool, unsigned int size, unsigned int align)
 
int kmemchk (mempool_t *pool, int verbose)
 
void * kmempoolbase (mempool_t *pool)
 
int kmempoolsize (mempool_t *pool)
 
int kmemstats (mempool_t *pool, memstats_t *stats)
 

Variables

mempool_t kmempool
 

Macro Definition Documentation

◆ KFREE

#define KFREE (   ptr)    kfree(&kmempool,(ptr))

Definition at line 93 of file lib_malloc.h.

◆ KMALLOC

#define KMALLOC (   size,
  align 
)    kmalloc(&kmempool,(size),(align))

Definition at line 92 of file lib_malloc.h.

◆ KMEMINIT

#define KMEMINIT (   buffer,
  length 
)    kmeminit(&kmempool,(buffer),(length))

Definition at line 89 of file lib_malloc.h.

◆ KMEMPOOLBASE

#define KMEMPOOLBASE ( )    kmempoolbase(&kmempool)

Definition at line 90 of file lib_malloc.h.

◆ KMEMPOOLSIZE

#define KMEMPOOLSIZE ( )    kmempoolsize(&kmempool)

Definition at line 91 of file lib_malloc.h.

◆ KMEMSTATS

#define KMEMSTATS (   s)    kmemstats(&kmempool,(s))

Definition at line 94 of file lib_malloc.h.

Typedef Documentation

◆ memnode_t

typedef struct memnode_s memnode_t

◆ mempool_t

typedef struct mempool_s mempool_t

Definition at line 79 of file lib_malloc.h.

◆ memstats_t

typedef struct memstats_s memstats_t

Enumeration Type Documentation

◆ memnode_status_t

Enumerator
memnode_free 
memnode_alloc 

Definition at line 62 of file lib_malloc.h.

Function Documentation

◆ kfree()

void kfree ( mempool_t pool,
void *  ptr 
)

Definition at line 205 of file lib_malloc.c.

◆ kmalloc()

void * kmalloc ( mempool_t pool,
unsigned int  size,
unsigned int  align 
)

Definition at line 266 of file lib_malloc.c.

◆ kmemchk()

int kmemchk ( mempool_t pool,
int  verbose 
)

◆ kmeminit()

void kmeminit ( mempool_t pool,
unsigned char *  buffer,
int  length 
)

Definition at line 93 of file lib_malloc.c.

◆ kmempoolbase()

void * kmempoolbase ( mempool_t pool)

Definition at line 118 of file lib_malloc.c.

◆ kmempoolsize()

int kmempoolsize ( mempool_t pool)

Definition at line 135 of file lib_malloc.c.

◆ kmemstats()

int kmemstats ( mempool_t pool,
memstats_t stats 
)

Definition at line 396 of file lib_malloc.c.

Variable Documentation

◆ kmempool

mempool_t kmempool
extern

Definition at line 74 of file lib_malloc.c.