SSBM Decomp
Loading...
Searching...
No Matches
OSAlloc.c File Reference
#include <dolphin.h>
#include <dolphin/os.h>

Data Structures

struct  Cell
struct  HeapDesc

Macros

#define ALIGNMENT   32
#define InRange(cell, arenaStart, arenaEnd)
#define HEADERSIZE   32u
#define MINOBJSIZE   64u
#define ASSERTREPORT(line, cond)

Functions

static struct CellDLAddFront (struct Cell *list, struct Cell *cell)
static struct CellDLLookup (struct Cell *list, struct Cell *cell)
static struct CellDLExtract (struct Cell *list, struct Cell *cell)
static struct CellDLInsert (struct Cell *list, struct Cell *cell)
static int DLOverlap (struct Cell *list, void *start, void *end)
static long DLSize (struct Cell *list)
void * OSAllocFromHeap (int heap, unsigned long size)
void * OSAllocFixed (void *rstart, void *rend)
void OSFreeToHeap (int heap, void *ptr)
int OSSetCurrentHeap (int heap)
void * OSInitAlloc (void *arenaStart, void *arenaEnd, int maxHeaps)
int OSCreateHeap (void *start, void *end)
void OSDestroyHeap (int heap)
void OSAddToHeap (int heap, void *start, void *end)
long OSCheckHeap (int heap)
unsigned long OSReferentSize (void *ptr)
void OSDumpHeap (int heap)
void OSVisitAllocated (void(*visitor)(void *, unsigned long))

Variables

volatile int __OSCurrHeap = -1
static struct HeapDescHeapArray
static int NumHeaps
static void * ArenaStart
static void * ArenaEnd

Macro Definition Documentation

◆ ALIGNMENT

#define ALIGNMENT   32

◆ InRange

#define InRange ( cell,
arenaStart,
arenaEnd )
Value:
((u32) arenaStart <= (u32) cell) && ((u32) cell < (u32) arenaEnd)
unsigned int u32
Definition types.h:13

◆ HEADERSIZE

#define HEADERSIZE   32u

◆ MINOBJSIZE

#define MINOBJSIZE   64u

◆ ASSERTREPORT

#define ASSERTREPORT ( line,
cond )
Value:
if (!(cond)) { \
OSReport("OSCheckHeap: Failed " #cond " in %d", line); \
return -1; \
}

Function Documentation

◆ DLAddFront()

struct Cell * DLAddFront ( struct Cell * list,
struct Cell * cell )
static

◆ DLLookup()

struct Cell * DLLookup ( struct Cell * list,
struct Cell * cell )
static

◆ DLExtract()

struct Cell * DLExtract ( struct Cell * list,
struct Cell * cell )
static

◆ DLInsert()

struct Cell * DLInsert ( struct Cell * list,
struct Cell * cell )
static

◆ DLOverlap()

int DLOverlap ( struct Cell * list,
void * start,
void * end )
static

◆ DLSize()

long DLSize ( struct Cell * list)
static

◆ OSAllocFromHeap()

void * OSAllocFromHeap ( int heap,
unsigned long size )

◆ OSAllocFixed()

void * OSAllocFixed ( void * rstart,
void * rend )

◆ OSFreeToHeap()

void OSFreeToHeap ( int heap,
void * ptr )

◆ OSSetCurrentHeap()

int OSSetCurrentHeap ( int heap)

◆ OSInitAlloc()

void * OSInitAlloc ( void * arenaStart,
void * arenaEnd,
int maxHeaps )

◆ OSCreateHeap()

int OSCreateHeap ( void * start,
void * end )

◆ OSDestroyHeap()

void OSDestroyHeap ( int heap)

◆ OSAddToHeap()

void OSAddToHeap ( int heap,
void * start,
void * end )

◆ OSCheckHeap()

long OSCheckHeap ( int heap)

◆ OSReferentSize()

unsigned long OSReferentSize ( void * ptr)

◆ OSDumpHeap()

void OSDumpHeap ( int heap)

◆ OSVisitAllocated()

void OSVisitAllocated ( void(* visitor )(void *, unsigned long))

Variable Documentation

◆ __OSCurrHeap

volatile int __OSCurrHeap = -1

◆ HeapArray

struct HeapDesc* HeapArray
static

◆ NumHeaps

int NumHeaps
static

◆ ArenaStart

void* ArenaStart
static

◆ ArenaEnd

void* ArenaEnd
static