[llvm-commits] CVS: poolalloc/runtime/FL2Allocator/FreeListAllocator.cpp

Chris Lattner lattner at cs.uiuc.edu
Wed Nov 10 16:32:55 PST 2004



Changes in directory poolalloc/runtime/FL2Allocator:

FreeListAllocator.cpp updated: 1.26 -> 1.27

---
Log message:

Make some stuff only happen when we're debugging


---
Diffs of the changes:  (+7 -4)

Index: poolalloc/runtime/FL2Allocator/FreeListAllocator.cpp
diff -u poolalloc/runtime/FL2Allocator/FreeListAllocator.cpp:1.26 poolalloc/runtime/FL2Allocator/FreeListAllocator.cpp:1.27
--- poolalloc/runtime/FL2Allocator/FreeListAllocator.cpp:1.26	Wed Nov 10 16:01:58 2004
+++ poolalloc/runtime/FL2Allocator/FreeListAllocator.cpp	Wed Nov 10 18:32:45 2004
@@ -250,8 +250,8 @@
   Pool->FreeNodeLists[0] = 0;   // This is our bump pointer.
   Pool->FreeNodeLists[1] = 0;   // This is our end pointer.
 
-  DO_IF_TRACE(fprintf(stderr, "[%d] poolinit_bp(0x%X, %d)\n", addPoolNumber(Pool),
-                      Pool, ObjAlignment));
+  DO_IF_TRACE(fprintf(stderr, "[%d] poolinit_bp(0x%X, %d)\n",
+                      addPoolNumber(Pool), Pool, ObjAlignment));
   DO_IF_PNP(++PoolsInited);  // Track # pools initialized
   DO_IF_PNP(InitPrintNumPools());
 }
@@ -265,6 +265,9 @@
   if (NumBytes >= LARGE_SLAB_SIZE)
     goto LargeObject;
 
+  DO_IF_PNP(++Pool->NumObjects);
+  DO_IF_PNP(Pool->BytesAllocated += NumBytes);
+
   if (NumBytes < 1) NumBytes = 1;
 
   unsigned Alignment;
@@ -397,8 +400,8 @@
   NumBytes = NumBytes+sizeof(FreedNodeHeader)+(Alignment-1);      // Round up
   NumBytes = (NumBytes & ~(Alignment-1))-sizeof(FreedNodeHeader); // Truncate
 
-  ++Pool->NumObjects;
-  Pool->BytesAllocated += NumBytes;
+  DO_IF_PNP(++Pool->NumObjects);
+  DO_IF_PNP(Pool->BytesAllocated += NumBytes);
 
   if (NumBytes >= LARGE_SLAB_SIZE-sizeof(PoolSlab)-sizeof(NodeHeader))
     goto LargeObject;





More information about the llvm-commits mailing list