Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
OSAlloc.h
Go to the documentation of this file.
1#ifndef OSALLOC_H
2#define OSALLOC_H
3
4#include "dolphin/types.h"
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
10typedef struct OSHeapDescriptor {
11 /* 0x0 */ s32 size;
12 /* 0x4 */ struct OSHeapCell* freeList;
13 /* 0x8 */ struct OSHeapCell* usedList;
15
16typedef struct OSHeapCell {
17 /* 0x00 */ struct OSHeapCell* prev;
18 /* 0x04 */ struct OSHeapCell* next;
19 /* 0x08 */ s32 size;
20 /* 0x0C */ struct OSHeapDescriptor* hd;
21 /* 0x10 */ s32 usedSize;
22 /* 0x14 */ char field_0x14[0x20 - 0x14];
24
26
27extern volatile s32 __OSCurrHeap;
28
29#define OSRoundUp32B(x) (((u32)(x) + 0x1F) & ~(0x1F))
30#define OSRoundDown32B(x) (((u32)(x)) & ~(0x1F))
31
32#define OSRoundUp(x, align) (((x) + (align)-1) & (-(align)))
33#define OSRoundUpPtr(x, align) ((void*)((((u32)(x)) + (align)-1) & (~((align)-1))))
34
35#define OSRoundDown(x, align) ((x) & (-(align)))
36#define OSRoundDownPtr(x, align) ((void*)(((u32)(x)) & (~((align)-1))))
37
39void OSFreeToHeap(OSHeapHandle handle, void* ptr);
41void* OSInitAlloc(void* lo, void* hi, s32 maxHeaps);
43
44#ifdef __cplusplus
45};
46#endif
47
48#endif /* OSALLOC_H */
volatile s32 __OSCurrHeap
Definition OSAlloc.c:74
s32 OSSetCurrentHeap(OSHeapHandle handle)
Definition OSAlloc.c:77
u32 OSHeapHandle
Definition OSAlloc.h:25
OSHeapHandle OSCreateHeap(void *start, void *end)
Definition OSAlloc.c:120
void OSFreeToHeap(OSHeapHandle handle, void *ptr)
Definition OSAlloc.c:65
void * OSInitAlloc(void *lo, void *hi, s32 maxHeaps)
Definition OSAlloc.c:94
static OSHeapCell * DLInsert(OSHeapCell *list, OSHeapCell *child)
T cLib_calcTimer(T *value)
Definition c_lib.h:74
static void end(b_oh_class *i_this)
Definition d_a_b_oh.cpp:527
static u8 child[40]
Definition d_a_e_rb.cpp:675
@ start
Definition strtoul.c:8
Definition OSAlloc.h:16
char field_0x14[0x20 - 0x14]
Definition OSAlloc.h:22
struct OSHeapDescriptor * hd
Definition OSAlloc.h:20
struct OSHeapCell * prev
Definition OSAlloc.h:17
s32 usedSize
Definition OSAlloc.h:21
struct OSHeapCell * next
Definition OSAlloc.h:18
s32 size
Definition OSAlloc.h:19
Definition OSAlloc.h:10
s32 size
Definition OSAlloc.h:11
struct OSHeapCell * usedList
Definition OSAlloc.h:13
struct OSHeapCell * freeList
Definition OSAlloc.h:12
unsigned long u32
Definition types.h:10
signed long s32
Definition types.h:6