WUT  0.1
Wii U Toolchain
expandedheap.h
Go to the documentation of this file.
1 #pragma once
2 #include <wut.h>
3 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
17 
18 typedef enum MEMExpandedHeapMode
19 {
23 
25 {
29 
31 {
32  uint32_t attribs;
33  uint32_t blockSize;
36  uint16_t tag;
37  UNKNOWN(0x02);
38 };
39 CHECK_OFFSET(MEMExpandedHeapBlock, 0x00, attribs);
40 CHECK_OFFSET(MEMExpandedHeapBlock, 0x04, blockSize);
41 CHECK_OFFSET(MEMExpandedHeapBlock, 0x08, prev);
42 CHECK_OFFSET(MEMExpandedHeapBlock, 0x0c, next);
43 CHECK_OFFSET(MEMExpandedHeapBlock, 0x10, tag);
44 CHECK_SIZE(MEMExpandedHeapBlock, 0x14);
45 
47 {
50 };
51 CHECK_OFFSET(MEMExpandedHeapBlockList, 0x00, head);
52 CHECK_OFFSET(MEMExpandedHeapBlockList, 0x04, tail);
53 CHECK_SIZE(MEMExpandedHeapBlockList, 0x08);
54 
56 {
60  uint16_t groupId;
61  uint16_t attribs;
62 };
63 CHECK_OFFSET(MEMExpandedHeap, 0x00, header);
64 CHECK_OFFSET(MEMExpandedHeap, 0x40, freeList);
65 CHECK_OFFSET(MEMExpandedHeap, 0x48, usedList);
66 CHECK_OFFSET(MEMExpandedHeap, 0x50, groupId);
67 CHECK_OFFSET(MEMExpandedHeap, 0x52, attribs);
68 CHECK_SIZE(MEMExpandedHeap, 0x54);
69 
72  uint32_t size,
73  uint16_t flags);
74 
77 
78 void *
80  uint32_t size,
81  int alignment);
82 
83 void
85  uint8_t *block);
86 
89  MEMExpandedHeapMode mode);
90 
93 
94 uint32_t
96 
97 uint32_t
99  uint8_t *address,
100  uint32_t size);
101 
102 uint32_t
104 
105 uint32_t
107  int alignment);
108 
109 uint16_t
111  uint16_t id);
112 
113 uint16_t
115 
116 uint32_t
117 MEMGetSizeForMBlockExpHeap(uint8_t *addr);
118 
119 uint16_t
120 MEMGetGroupIDForMBlockExpHeap(uint8_t *addr);
121 
123 MEMGetAllocDirForMBlockExpHeap(uint8_t *addr);
124 
125 #ifdef __cplusplus
126 }
127 #endif
128 
uint32_t MEMResizeForMBlockExpHeap(MEMExpandedHeap *heap, uint8_t *address, uint32_t size)
MEMExpandedHeapBlockList freeList
Definition: expandedheap.h:58
uint32_t MEMGetTotalFreeSizeForExpHeap(MEMExpandedHeap *heap)
MEMExpandedHeapDirection MEMGetAllocDirForMBlockExpHeap(uint8_t *addr)
uint16_t groupId
Definition: expandedheap.h:60
MEMHeapHeader header
Definition: expandedheap.h:57
uint32_t MEMGetAllocatableSizeForExpHeapEx(MEMExpandedHeap *heap, int alignment)
MEMExpandedHeapMode MEMSetAllocModeForExpHeap(MEMExpandedHeap *heap, MEMExpandedHeapMode mode)
void * MEMAllocFromExpHeapEx(MEMExpandedHeap *heap, uint32_t size, int alignment)
uint16_t MEMGetGroupIDForMBlockExpHeap(uint8_t *addr)
MEMExpandedHeapBlock * next
Definition: expandedheap.h:35
void MEMFreeToExpHeap(MEMExpandedHeap *heap, uint8_t *block)
MEMExpandedHeap * MEMDestroyExpHeap(MEMExpandedHeap *heap)
MEMExpandedHeapMode
Definition: expandedheap.h:18
MEMExpandedHeap * MEMCreateExpHeapEx(MEMExpandedHeap *heap, uint32_t size, uint16_t flags)
MEMExpandedHeapMode MEMGetAllocModeForExpHeap(MEMExpandedHeap *heap)
MEMExpandedHeapBlock * tail
Definition: expandedheap.h:49
uint32_t MEMGetSizeForMBlockExpHeap(uint8_t *addr)
uint32_t MEMAdjustExpHeap(MEMExpandedHeap *heap)
uint16_t MEMSetGroupIDForExpHeap(MEMExpandedHeap *heap, uint16_t id)
uint16_t attribs
Definition: expandedheap.h:61
MEMExpandedHeapDirection
Definition: expandedheap.h:24
MEMExpandedHeapBlockList usedList
Definition: expandedheap.h:59
MEMExpandedHeapBlock * head
Definition: expandedheap.h:48
MEMExpandedHeapBlock * prev
Definition: expandedheap.h:34
uint16_t MEMGetGroupIDForExpHeap(MEMExpandedHeap *heap)