diff --git a/Core/Memory/HeapAllocators/Xalloc/Xalloc.hpp b/Core/Memory/HeapAllocators/Xalloc/Xalloc.hpp index 9a484f8..ab03876 100644 --- a/Core/Memory/HeapAllocators/Xalloc/Xalloc.hpp +++ b/Core/Memory/HeapAllocators/Xalloc/Xalloc.hpp @@ -8,6 +8,7 @@ typedef long unsigned Xuint64_t; typedef long unsigned Xsize_t; +#define Xalloc_StopOnFail true #define Xalloc_PAGE_SIZE PAGE_SIZE #define Xalloc_trace(m, ...) trace(m, ##__VA_ARGS__) #define Xalloc_warn(m, ...) warn(m, ##__VA_ARGS__) diff --git a/Core/Memory/HeapAllocators/Xalloc/XallocV1.cpp b/Core/Memory/HeapAllocators/Xalloc/XallocV1.cpp index f7fba53..4671428 100644 --- a/Core/Memory/HeapAllocators/Xalloc/XallocV1.cpp +++ b/Core/Memory/HeapAllocators/Xalloc/XallocV1.cpp @@ -150,7 +150,10 @@ namespace Xalloc { if (!CurrentBlock->Check()) { - Xalloc_err("Block %#lx checksum failed!", (Xuint64_t)CurrentBlock); + Xalloc_err("Block %#lx has an invalid checksum! (%#x != %#x)", + (Xuint64_t)CurrentBlock, CurrentBlock->Checksum, Xalloc_BlockChecksum); + while (Xalloc_StopOnFail) + ; } else if (CurrentBlock->IsFree && CurrentBlock->Size >= Size) { @@ -190,6 +193,8 @@ namespace Xalloc if (!CurrentBlock->Check()) { Xalloc_err("Block %#lx checksum failed!", (Xuint64_t)CurrentBlock); + while (Xalloc_StopOnFail) + ; } else if (CurrentBlock->Address == Address) {