mm/include/os_malloc.h
Derek Hensley 26207594f2
Format Script Update (#904)
* Bring over format.sh and .clang-tidy and run it

* Little fixes

* Adjustments

* Jenkins kick

* Jenkins kick 2

* format

* small fixes

* Bring over new formatter by Roman

Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>

* Force use of clang-11

* check_format

* Update error messages

* Fix from Tharo for python3.6

Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>

* Just use nproc to determine num jobs for check format

* Update error message

* AnimatedMat_DrawStepOpa texture arg -> matAnim

* Fix enTwig draw prototype

* Tidying up

* Bring over fixes in OoT #1387

Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>

* Fix

* Update doc tools

* PR

Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>
Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>
2022-10-04 04:06:04 +01:00

36 lines
1.0 KiB
C

#ifndef OS_MALLOC
#define OS_MALLOC
#include "PR/ultratypes.h"
#include "ultra64/message.h"
#include "libc/stddef.h"
typedef struct ArenaNode {
/* 0x0 */ s16 magic; // Should always be 0x7373
/* 0x2 */ s16 isFree;
/* 0x4 */ size_t size;
/* 0x8 */ struct ArenaNode* next;
/* 0xC */ struct ArenaNode* prev;
} ArenaNode; // size = 0x10
typedef struct {
/* 0x00 */ ArenaNode* head;
/* 0x04 */ void* start;
/* 0x08 */ OSMesgQueue lock;
/* 0x20 */ u8 unk20;
/* 0x21 */ u8 isInit;
/* 0x22 */ u8 flag;
} Arena; // size = 0x24
void __osMallocInit(Arena* arena, void* heap, size_t size);
void __osMallocCleanup(Arena* arena);
u8 __osMallocIsInitalized(Arena* arena);
void* __osMalloc(Arena* arena, size_t size);
void* __osMallocR(Arena* arena, size_t size);
void __osFree(Arena* arena, void* ptr);
void* __osRealloc(Arena* arena, void* ptr, size_t newSize);
void __osGetSizes(Arena* arena, size_t* outMaxFree, size_t* outFree, size_t* outAlloc);
s32 __osCheckArena(Arena* arena);
#endif