summaryrefslogtreecommitdiff
path: root/memory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'memory.cpp')
-rw-r--r--memory.cpp21
1 files changed, 21 insertions, 0 deletions
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
+}