Skip to content

Commit 08cfb34

Browse files
authored
coreinit: Add MEMCheckExpHeap and MEMCheckHeap (#358)
* coreinit: Add MEMCheckExpHeap and MEMCheckHeap * coreinit: Fix MEMCheckExpHeap and MEMCheckHeap functions
1 parent 669a63b commit 08cfb34

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

include/coreinit/memexpheap.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ typedef enum MEMExpHeapDirection
3131
MEM_EXP_HEAP_DIR_FROM_BOTTOM = 1,
3232
} MEMExpHeapDirection;
3333

34+
typedef enum MEMExpHeapCheckFlags
35+
{
36+
MEM_EXP_HEAP_CHECK_FLAGS_NONE = 0,
37+
MEM_EXP_HEAP_CHECK_FLAGS_LOG_ERRORS = 1,
38+
} MEMExpHeapCheckFlags;
39+
3440
struct MEMExpHeapBlock
3541
{
3642
uint32_t attribs;
@@ -131,6 +137,10 @@ MEMVisitAllocatedForExpHeap(MEMHeapHandle heap,
131137
MEMExpHeapBlockVisitor callback,
132138
void *context);
133139

140+
BOOL
141+
MEMCheckExpHeap(MEMHeapHandle handle,
142+
MEMExpHeapCheckFlags mode);
143+
134144
#ifdef __cplusplus
135145
}
136146
#endif

include/coreinit/memheap.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,12 @@ void
144144
MEMSetFillValForHeap(MEMHeapFillType type,
145145
uint32_t value);
146146

147+
/**
148+
* Checks the heap for corruption
149+
*/
150+
BOOL
151+
MEMCheckHeap(MEMHeapHandle handle);
152+
147153
#ifdef __cplusplus
148154
}
149155
#endif

0 commit comments

Comments
 (0)