coreinit: Add MEMCheckExpHeap and MEMCheckHeap (#358)

* coreinit: Add MEMCheckExpHeap and MEMCheckHeap

* coreinit: Fix MEMCheckExpHeap and MEMCheckHeap functions
This commit is contained in:
Maschell
2024-04-20 19:25:24 +02:00
committed by GitHub
parent 669a63bd0c
commit 08cfb34e0b
2 changed files with 16 additions and 0 deletions

View File

@@ -31,6 +31,12 @@ typedef enum MEMExpHeapDirection
MEM_EXP_HEAP_DIR_FROM_BOTTOM = 1,
} MEMExpHeapDirection;
typedef enum MEMExpHeapCheckFlags
{
MEM_EXP_HEAP_CHECK_FLAGS_NONE = 0,
MEM_EXP_HEAP_CHECK_FLAGS_LOG_ERRORS = 1,
} MEMExpHeapCheckFlags;
struct MEMExpHeapBlock
{
uint32_t attribs;
@@ -131,6 +137,10 @@ MEMVisitAllocatedForExpHeap(MEMHeapHandle heap,
MEMExpHeapBlockVisitor callback,
void *context);
BOOL
MEMCheckExpHeap(MEMHeapHandle handle,
MEMExpHeapCheckFlags mode);
#ifdef __cplusplus
}
#endif

View File

@@ -144,6 +144,12 @@ void
MEMSetFillValForHeap(MEMHeapFillType type,
uint32_t value);
/**
* Checks the heap for corruption
*/
BOOL
MEMCheckHeap(MEMHeapHandle handle);
#ifdef __cplusplus
}
#endif