more asserts

This commit is contained in:
2026-06-14 04:17:03 +02:00
parent 088a3648dd
commit 2289ec8644
2 changed files with 5 additions and 2 deletions

View File

@@ -610,7 +610,10 @@ MIHP_HeapMemoryAreaHeader* MIHP_CreateHeapMemoryArea(MIHP_Heap* heap, size_t req
if (area == NULL) if (area == NULL)
return NULL; return NULL;
MIHP_ASSERT((uintptr_t)area % heap->Config.AllocationAlignment == 0);
MIHP_ASSERT(actualSize % heap->Config.AllocationAlignment == 0);
MIHP_ASSERT(actualSize >= effectiveSize); MIHP_ASSERT(actualSize >= effectiveSize);
MIHP_MEMSET(area, 0, sizeof(MIHP_HeapMemoryAreaHeader)); MIHP_MEMSET(area, 0, sizeof(MIHP_HeapMemoryAreaHeader));
area->InstigatingHeap = (MIHP_HeapOpaque)heap; area->InstigatingHeap = (MIHP_HeapOpaque)heap;

View File

@@ -10,7 +10,7 @@
#define USE_MALLOC 0 #define USE_MALLOC 0
//#define MIHP_ValidateHeap(x) #define MIHP_ValidateHeap(x)
void* RequestMemory(MIHP_HeapOpaque heap, size_t minRequestedSize, size_t* outActualSize) void* RequestMemory(MIHP_HeapOpaque heap, size_t minRequestedSize, size_t* outActualSize)
{ {
@@ -29,7 +29,7 @@ void OnHeapCorruptionDetectedCallback(const MIHP_Heap* heap, MIHP_HeapCorruption
__debugbreak(); __debugbreak();
} }
#define NUM_ALLOCATIONS (4096) #define NUM_ALLOCATIONS (4096 * 4096)
void* myptrs[NUM_ALLOCATIONS] = { 0 }; void* myptrs[NUM_ALLOCATIONS] = { 0 };