blob: 2b58e3bd310fddd7a21ab8baafdfc86f054f453d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#ifndef RVL_SDK_MEM_ALLOCATOR_H
#define RVL_SDK_MEM_ALLOCATOR_H
#include "common.h"
#ifdef __cplusplus
extern "C" {
#endif
// Forward declarations
typedef struct MEMAllocator;
typedef struct MEMiHeapHead;
typedef void *(*MEMAllocatorAllocFunc)(struct MEMAllocator *allocator, u32 size);
typedef void (*MEMAllocatorFreeFunc)(struct MEMAllocator *allocator, void *block);
typedef struct MEMAllocatorFuncs {
MEMAllocatorAllocFunc allocFunc; // at 0x0
MEMAllocatorFreeFunc freeFunc; // at 0x4
} MEMAllocatorFuncs;
typedef struct MEMAllocator {
const MEMAllocatorFuncs *funcs; // at 0x0
void *heap; // at 0x4
u32 heapParam1; // at 0x8
u32 heapParam2; // at 0xC
} MEMAllocator;
void *MEMAllocFromAllocator(MEMAllocator *allocator, u32 size);
void MEMFreeToAllocator(MEMAllocator *allocator, void *block);
void MEMInitAllocatorForExpHeap(MEMAllocator *allocator, struct MEMiHeapHead *heap, s32 align);
void MEMInitAllocatorForFrmHeap(MEMAllocator *allocator, struct MEMiHeapHead *heap, s32 align);
#ifdef __cplusplus
}
#endif
#endif
|