mirror of
https://github.com/zeldaret/tp
synced 2026-05-23 06:54:28 -04:00
8185d87f85
* initial copy of hbm from sdk_2009-12-11 * some more nw4hbm cleanup * nw4hbm db mostly done * nw4hbm snd copied from oot-vc * nw4hbm ut copied * nw4hbm lyt copied * nw4hbm copied, mostly matching usa 1.0 * setup nw4hbm debug define * fix HBMDataInfo struct * add rvl sdk card lib
38 lines
980 B
C
38 lines
980 B
C
#ifndef _REVOLUTION_MEM_ALLOCATOR_H_
|
|
#define _REVOLUTION_MEM_ALLOCATOR_H_
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#include <revolution/mem/heapCommon.h>
|
|
#include <revolution/types.h>
|
|
|
|
typedef struct MEMAllocator MEMAllocator;
|
|
typedef void* (*MEMFuncAllocatorAlloc)(MEMAllocator* pAllocator, u32 size);
|
|
typedef void (*MEMFuncAllocatorFree)(MEMAllocator* pAllocator, void* memBlock);
|
|
typedef struct MEMAllocatorFunc MEMAllocatorFunc;
|
|
|
|
struct MEMAllocatorFunc {
|
|
MEMFuncAllocatorAlloc pfAlloc;
|
|
MEMFuncAllocatorFree pfFree;
|
|
};
|
|
|
|
struct MEMAllocator {
|
|
const MEMAllocatorFunc* pFunc;
|
|
void* pHeap;
|
|
u32 heapParam1;
|
|
u32 heapParam2;
|
|
};
|
|
|
|
void* MEMAllocFromAllocator(MEMAllocator*, u32);
|
|
void MEMFreeToAllocator(MEMAllocator*, void*);
|
|
void MEMInitAllocatorForExpHeap(MEMAllocator*, MEMHeapHandle, int);
|
|
void MEMInitAllocatorForFrmHeap(MEMAllocator* allocator, struct MEMiHeapHead* heap, s32 align);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif // _REVOLUTION_MEM_ALLOCATOR_H_
|