mirror of
https://github.com/PrimeDecomp/prime.git
synced 2025-12-12 23:26:07 +00:00
30
include/dolphin/os/OSAlloc.h
Normal file
30
include/dolphin/os/OSAlloc.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#ifndef _DOLPHIN_OSALLOC
|
||||
#define _DOLPHIN_OSALLOC
|
||||
|
||||
#include <dolphin/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
typedef int OSHeapHandle;
|
||||
typedef void (*OSAllocVisitor)(void* obj, u32 size);
|
||||
void* OSInitAlloc(void* arenaStart, void* arenaEnd, int maxHeaps);
|
||||
OSHeapHandle OSCreateHeap(void* start, void* end);
|
||||
void OSDestroyHeap(OSHeapHandle heap);
|
||||
void OSAddToHeap(OSHeapHandle heap, void* start, void* end);
|
||||
OSHeapHandle OSSetCurrentHeap(OSHeapHandle heap);
|
||||
void* OSAllocFromHeap(OSHeapHandle heap, u32 size);
|
||||
void* OSAllocFixed(void** rstart, void** rend);
|
||||
void OSFreeToHeap(OSHeapHandle heap, void* ptr);
|
||||
long OSCheckHeap(OSHeapHandle heap);
|
||||
void OSDumpHeap(OSHeapHandle heap);
|
||||
u32 OSReferentSize(void* ptr);
|
||||
void OSVisitAllocated(OSAllocVisitor visitor);
|
||||
extern volatile OSHeapHandle __OSCurrHeap;
|
||||
#define OSAlloc(size) OSAllocFromHeap(__OSCurrHeap, (size))
|
||||
#define OSFree(ptr) OSFreeToHeap(__OSCurrHeap, (ptr))
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _DOLPHIN_OSALLOC
|
||||
Reference in New Issue
Block a user