From bccb1d61907fea45c5e84b29499989f7cee104a5 Mon Sep 17 00:00:00 2001 From: Fox Caminiti Date: Thu, 4 Aug 2022 12:33:54 -0400 Subject: loaded bitmap wrap buffer seems stable --- memory.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'memory.cpp') diff --git a/memory.cpp b/memory.cpp index fcd7627..4177448 100644 --- a/memory.cpp +++ b/memory.cpp @@ -29,3 +29,24 @@ Memory_NormalizedPosition(void *StartingPointer, uint32 Amount, uint32 Size, voi Result = (real32)PointerLocationSize / (real32)TotalSize; return Result; } + +static void +Debug_Memory_Assert_Cohesion(memory *Memory, memory_table *Table) +{ +#if DEBUG + for (uint32 i = 0; i < Table->NumberOfPointers; i++) { + cached_bitmap *CurrentBitmap = &Memory->Bitmap[i]; + Assert(CurrentBitmap->Data); + for (uint32 a = 0; a < Table->NumberOfPointers; a++) { + if (a == i) { + continue; + } + cached_bitmap *OtherBitmap = &Memory->Bitmap[a]; + if (OtherBitmap->Data == CurrentBitmap->Data) { + Assert(0); + } + } + } +#else +#endif +} -- cgit v1.2.3