wut  v1.7.0
Wii U Toolchain
memfrmheap.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 enum MEMFrmHeapFreeMode
16 {
21 
22 typedef struct MEMFrmHeap MEMFrmHeap;
23 typedef struct MEMFrmHeapState MEMFrmHeapState;
24 
26 {
27  uint32_t tag;
28  void *head;
29  void *tail;
31 };
32 WUT_CHECK_OFFSET(MEMFrmHeapState, 0x00, tag);
33 WUT_CHECK_OFFSET(MEMFrmHeapState, 0x04, head);
34 WUT_CHECK_OFFSET(MEMFrmHeapState, 0x08, tail);
35 WUT_CHECK_OFFSET(MEMFrmHeapState, 0x0C, previous);
36 WUT_CHECK_SIZE(MEMFrmHeapState, 0x10);
37 
38 struct WUT_PACKED MEMFrmHeap
39 {
41  void *head;
42  void *tail;
44 };
45 WUT_CHECK_OFFSET(MEMFrmHeap, 0x00, header);
46 WUT_CHECK_OFFSET(MEMFrmHeap, 0x40, head);
47 WUT_CHECK_OFFSET(MEMFrmHeap, 0x44, tail);
48 WUT_CHECK_OFFSET(MEMFrmHeap, 0x48, previousState);
49 WUT_CHECK_SIZE(MEMFrmHeap, 0x4C);
50 
52 MEMCreateFrmHeapEx(void *heap,
53  uint32_t size,
54  uint32_t flags);
55 
56 void *
58 
59 void *
61  uint32_t size,
62  int alignment);
63 
64 void
66  MEMFrmHeapFreeMode mode);
67 
68 BOOL
70  uint32_t tag);
71 
72 BOOL
74  uint32_t tag);
75 
76 uint32_t
78 
79 uint32_t
81  uint32_t addr,
82  uint32_t size);
83 
84 uint32_t
86  int alignment);
87 
88 #ifdef __cplusplus
89 }
90 #endif
91 
MEMHeapHeader header
Definition: memfrmheap.h:40
uint32_t tag
Definition: memfrmheap.h:27
MEMFrmHeapState * previous
Definition: memfrmheap.h:30
MEMFrmHeapState * previousState
Definition: memfrmheap.h:43
void * MEMDestroyFrmHeap(MEMHeapHandle heap)
MEMHeapHandle MEMCreateFrmHeapEx(void *heap, uint32_t size, uint32_t flags)
MEMFrmHeapFreeMode
Definition: memfrmheap.h:16
uint32_t MEMResizeForMBlockFrmHeap(MEMHeapHandle heap, uint32_t addr, uint32_t size)
uint32_t MEMAdjustFrmHeap(MEMHeapHandle heap)
BOOL MEMFreeByStateToFrmHeap(MEMHeapHandle heap, uint32_t tag)
void MEMFreeToFrmHeap(MEMHeapHandle heap, MEMFrmHeapFreeMode mode)
uint32_t MEMGetAllocatableSizeForFrmHeapEx(MEMHeapHandle heap, int alignment)
void * MEMAllocFromFrmHeapEx(MEMHeapHandle heap, uint32_t size, int alignment)
BOOL MEMRecordStateForFrmHeap(MEMHeapHandle heap, uint32_t tag)
@ MEM_FRM_HEAP_FREE_ALL
Definition: memfrmheap.h:19
@ MEM_FRM_HEAP_FREE_TAIL
Definition: memfrmheap.h:18
@ MEM_FRM_HEAP_FREE_HEAD
Definition: memfrmheap.h:17
int32_t BOOL
Definition: wut_types.h:7