Update minimal_heap_test.cpp

This commit is contained in:
2026-06-13 07:22:48 +02:00
parent 3db14274f9
commit bed4193d78

View File

@@ -48,17 +48,20 @@ void BootstrapHeap()
config.HeapValidationMode = MIHP_HVM_MagicNumber; config.HeapValidationMode = MIHP_HVM_MagicNumber;
MIHP_Heap* tmpHeap = new MIHP_Heap(); MIHP_Heap* bootstrappedHeap = NULL;
memset(tmpHeap, 0, sizeof(MIHP_Heap));
MIHP_InitializeHeap(tmpHeap, config);
MIHP_Heap* bootstrappedHeap = (MIHP_Heap*)MIHP_Allocate(tmpHeap, sizeof(MIHP_Heap)); {
memset(bootstrappedHeap, 0, sizeof(MIHP_Heap)); MIHP_Heap tmpHeap = { 0 };
MIHP_InitializeHeap(bootstrappedHeap, config); MIHP_InitializeHeap(&tmpHeap, config);
MIHP_MergeHeaps(bootstrappedHeap, tmpHeap); MIHP_Heap* bootstrappedHeap = (MIHP_Heap*)MIHP_Allocate(&tmpHeap, sizeof(MIHP_Heap));
delete tmpHeap; memset(bootstrappedHeap, 0, sizeof(MIHP_Heap));
//MIHP_Free(bootstrappedHeap, bootstrappedHeap); MIHP_InitializeHeap(bootstrappedHeap, config);
MIHP_MergeHeaps(bootstrappedHeap, &tmpHeap);
}
// bootstrappedHeap is ready to use
__debugbreak(); __debugbreak();
} }