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

John Criswell criswell at cs.uiuc.edu
Thu Nov 13 22:36:01 PST 2003


Changes in directory poolalloc/runtime/FreeListAllocator:

PoolAllocator.cpp updated: 1.17 -> 1.18

---
Log message:

Removed dead code.
Inlined the functions that compute slab pointers from data block/pointer
values.



---
Diffs of the changes:  (+2 -42)

Index: poolalloc/runtime/FreeListAllocator/PoolAllocator.cpp
diff -u poolalloc/runtime/FreeListAllocator/PoolAllocator.cpp:1.17 poolalloc/runtime/FreeListAllocator/PoolAllocator.cpp:1.18
--- poolalloc/runtime/FreeListAllocator/PoolAllocator.cpp:1.17	Thu Nov 13 18:16:30 2003
+++ poolalloc/runtime/FreeListAllocator/PoolAllocator.cpp	Thu Nov 13 22:35:10 2003
@@ -115,7 +115,7 @@
 // Description:
 //  Find the slab that owns this block.
 //
-struct SlabHeader *
+inline struct SlabHeader *
 BlockOwner (unsigned int PageSize, NodePointer p)
 {
   //
@@ -130,38 +130,12 @@
 // Description:
 //  This function finds the slab that owns this data block.
 //
-struct SlabHeader *
+inline struct SlabHeader *
 DataOwner (unsigned int PageSize, void * p)
 {
   return reinterpret_cast<struct SlabHeader *>(reinterpret_cast<unsigned int>(p) & ~(PageSize - 1));
 }
 
-//
-// Function: slabAlloc()
-//
-// Description:
-//  Increase the slab's reference count.
-//
-void
-slabAlloc (SlabHeader * Slab)
-{
-  Slab->LiveNodes++;
-  return;
-}
-
-//
-// Function: slabFree ()
-//
-// Description:
-//  Decrease the slab's reference count.
-//
-void
-slabFree (SlabHeader * Slab)
-{
-  Slab->LiveNodes--;
-  return;
-}
-
 //===----------------------------------------------------------------------===//
 //
 //  Pool allocator library implementation
@@ -314,13 +288,6 @@
   }
 
   //
-  // Increase the slab's reference count.
-  //
-#if 0
-  slabAlloc (Pool->FreeList->Slab);
-#endif /* 0 */
-
-  //
   // Determine which slab owns this block.
   //
   struct SlabHeader * slabp = BlockOwner (PageSize, Pool->FreeList);
@@ -422,13 +389,6 @@
   //
   NodePointer Node;
   Node.Next = &(slabp->BlockList[((unsigned char *)Block - slabp->Data)/Pool->NodeSize]);
-
-#if 0
-  //
-  // Decrease the slab's reference count.
-  //
-  slabFree (Node.header->Slab);
-#endif /* 0 */
 
   //
   // Add the node back to the free list.





More information about the llvm-commits mailing list