diff options
Diffstat (limited to 'memory.cpp')
-rw-r--r-- | memory.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -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 +} |