wut  1.0.0-beta9
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;
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 
MEMResizeForMBlockFrmHeap
uint32_t MEMResizeForMBlockFrmHeap(MEMHeapHandle heap, uint32_t addr, uint32_t size)
MEMCreateFrmHeapEx
MEMHeapHandle MEMCreateFrmHeapEx(void *heap, uint32_t size, uint32_t flags)
MEMFrmHeap
Definition: memfrmheap.h:38
MEM_FRM_HEAP_FREE_TAIL
@ MEM_FRM_HEAP_FREE_TAIL
Definition: memfrmheap.h:18
memheap.h
MEMFrmHeap::previousState
MEMFrmHeapState * previousState
Definition: memfrmheap.h:43
MEMFrmHeapFreeMode
MEMFrmHeapFreeMode
Definition: memfrmheap.h:15
MEMFrmHeap::header
MEMHeapHeader header
Definition: memfrmheap.h:40
wut.h
MEMFrmHeapState::tag
uint32_t tag
Definition: memfrmheap.h:27
MEMFrmHeapState::head
void * head
Definition: memfrmheap.h:28
MEMFrmHeapState
Definition: memfrmheap.h:25
MEMAllocFromFrmHeapEx
void * MEMAllocFromFrmHeapEx(MEMHeapHandle heap, uint32_t size, int alignment)
MEMGetAllocatableSizeForFrmHeapEx
uint32_t MEMGetAllocatableSizeForFrmHeapEx(MEMHeapHandle heap, int alignment)
MEMFreeToFrmHeap
void MEMFreeToFrmHeap(MEMHeapHandle heap, MEMFrmHeapFreeMode mode)
MEMFrmHeapState::previous
MEMFrmHeapState * previous
Definition: memfrmheap.h:30
MEM_FRM_HEAP_FREE_ALL
@ MEM_FRM_HEAP_FREE_ALL
Definition: memfrmheap.h:19
MEMFrmHeapState::tail
void * tail
Definition: memfrmheap.h:29
MEM_FRM_HEAP_FREE_HEAD
@ MEM_FRM_HEAP_FREE_HEAD
Definition: memfrmheap.h:17
MEMFreeByStateToFrmHeap
BOOL MEMFreeByStateToFrmHeap(MEMHeapHandle heap, uint32_t tag)
BOOL
int32_t BOOL
Definition: wut_types.h:4
MEMDestroyFrmHeap
void * MEMDestroyFrmHeap(MEMHeapHandle heap)
MEMHeapHeader
Definition: memheap.h:51
MEMRecordStateForFrmHeap
BOOL MEMRecordStateForFrmHeap(MEMHeapHandle heap, uint32_t tag)
MEMAdjustFrmHeap
uint32_t MEMAdjustFrmHeap(MEMHeapHandle heap)