PS2SDK
PS2 Homebrew Libraries
|
#include <stdarg.h>
#include "types.h"
#include "defs.h"
#include "alloc.h"
#include "irx_imports.h"
Go to the source code of this file.
Data Structures | |
struct | _heap_mem_header |
Macros | |
#define | MODNAME "alloc" |
#define | DEFAULT_HEAP_SIZE 128 * 1024 |
#define | DEFAULT_ALIGNMENT 16 |
#define | ALIGN(x, align) |
Typedefs | |
typedef struct _heap_mem_header | heap_mem_header_t |
Functions | |
IRX_ID ("Basic alloc library", 1, 1) | |
static void | alloc_lock () |
static void | alloc_unlock () |
int | _start (int argc, char *argv[]) |
int | shutdown () |
static void * | alloc_sbrk (size_t increment) |
static heap_mem_header_t * | _heap_mem_fit (heap_mem_header_t *head, size_t size) |
void * | malloc (size_t size) |
void * | realloc (void *ptr, size_t size) |
void * | calloc (size_t n, size_t size) |
void * | memalign (size_t align, size_t size) |
void | free (void *ptr) |
void * | __mem_walk_begin () |
void | __mem_walk_read (void *token, u32 *size, void **ptr, int *valid) |
void * | __mem_walk_inc (void *token) |
int | __mem_walk_end (void *token) |
Variables | |
struct irx_export_table | _exp_alloc |
static vs32 | alloc_sema = -1 |
u32 | heap_size = DEFAULT_HEAP_SIZE |
static u8 * | heap_start |
static u8 * | heap_end |
static u8 * | _heap_ptr |
static void * | __alloc_heap_base = NULL |
static heap_mem_header_t * | __alloc_heap_head = NULL |
static heap_mem_header_t * | __alloc_heap_tail = NULL |
Basic alloc library
Definition in file alloc.c.
struct _heap_mem_header |
Data Fields | ||
---|---|---|
void * | ptr | |
size_t | size | |
struct _heap_mem_header * | prev | |
struct _heap_mem_header * | next |
#define DEFAULT_ALIGNMENT 16 |
#define ALIGN | ( | x, | |
align ) |
|
static |
void __mem_walk_read | ( | void * | token, |
u32 * | size, | ||
void ** | ptr, | ||
int * | valid ) |
|
static |
|
static |