WUT  0.1
Wii U Toolchain
unitheap.h
Go to the documentation of this file.
1 #pragma once
2 #include <wut.h>
3 #include "memheap.h"
4 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 typedef struct MEMUnitHeap MEMUnitHeap;
17 
19 {
21 };
22 CHECK_OFFSET(MEMUnitHeapFreeBlock, 0x00, next);
23 CHECK_SIZE(MEMUnitHeapFreeBlock, 0x04);
24 
26 {
29  uint32_t blockSize;
30 };
31 CHECK_OFFSET(MEMUnitHeap, 0x00, header);
32 CHECK_OFFSET(MEMUnitHeap, 0x40, freeBlocks);
33 CHECK_OFFSET(MEMUnitHeap, 0x44, blockSize);
34 CHECK_SIZE(MEMUnitHeap, 0x48);
35 
38  uint32_t size,
39  uint32_t blockSize,
40  int32_t alignment,
41  uint16_t flags);
42 
43 void *
45 
46 void *
48 
49 void
51  void *block);
52 
53 void
55 
56 uint32_t
58 
59 uint32_t
60 MEMCalcHeapSizeForUnitHeap(uint32_t blockSize,
61  uint32_t count,
62  int32_t alignment);
63 
64 #ifdef __cplusplus
65 }
66 #endif
67 
void * MEMAllocFromUnitHeap(MEMUnitHeap *heap)
void * MEMDestroyUnitHeap(MEMUnitHeap *heap)
MEMUnitHeapFreeBlock * next
Definition: unitheap.h:20
MEMUnitHeap * MEMCreateUnitHeapEx(MEMUnitHeap *heap, uint32_t size, uint32_t blockSize, int32_t alignment, uint16_t flags)
MEMUnitHeapFreeBlock * freeBlocks
Definition: unitheap.h:28
void MEMFreeToUnitHeap(MEMUnitHeap *heap, void *block)
uint32_t MEMCalcHeapSizeForUnitHeap(uint32_t blockSize, uint32_t count, int32_t alignment)
uint32_t MEMCountFreeBlockForUnitHeap(MEMUnitHeap *heap)
uint32_t blockSize
Definition: unitheap.h:29
MEMHeapHeader header
Definition: unitheap.h:27
void MEMiDumpUnitHeap(MEMUnitHeap *heap)