summaryrefslogtreecommitdiff
path: root/memory.cpp
diff options
context:
space:
mode:
authorFox Caminiti <fox@foxcam.net>2022-08-04 12:33:54 -0400
committerFox Caminiti <fox@foxcam.net>2022-08-04 12:33:54 -0400
commitbccb1d61907fea45c5e84b29499989f7cee104a5 (patch)
tree8e70ecab3bce134d2b5100cfd67f37dee2dccda3 /memory.cpp
parent8875d0226f0d38a1e5ef946e56cd15810627f5ac (diff)
loaded bitmap wrap buffer seems stable
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
+}