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

John Criswell criswell at cs.uiuc.edu
Fri Nov 14 15:38:02 PST 2003


Changes in directory poolalloc/runtime/FreeListAllocator:

PoolAllocator.cpp updated: 1.25 -> 1.26

---
Log message:

Disable faster array allocation until it works.



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

Index: poolalloc/runtime/FreeListAllocator/PoolAllocator.cpp
diff -u poolalloc/runtime/FreeListAllocator/PoolAllocator.cpp:1.25 poolalloc/runtime/FreeListAllocator/PoolAllocator.cpp:1.26
--- poolalloc/runtime/FreeListAllocator/PoolAllocator.cpp:1.25	Fri Nov 14 13:47:12 2003
+++ poolalloc/runtime/FreeListAllocator/PoolAllocator.cpp	Fri Nov 14 15:36:52 2003
@@ -331,6 +331,7 @@
   // Check to see if we have an array slab that has extra space that we
   // can use.
   //
+#if 0
   if ((Slabp != NULL) &&
       ((Pool->MaxNodesPerPage - Slabp->NextFreeData) >= ArraySize))
   {
@@ -343,9 +344,10 @@
     // Return the data to the caller.
     //
     void * Data = (Slabp->Data + (Pool->NodeSize * Slabp->NextFreeData));
-    (Slabp->NextFreeData)++;
+    (Slabp->NextFreeData) += ArraySize;
     return (Data);
   }
+#endif /* 0 */
 
   //
   // Scan through all the free array slabs to see if they are large
@@ -356,7 +358,7 @@
     //
     // Check to see if this slab has enough room.
     //
-    if (Slabp->NodesPerSlab >= ArraySize)
+    if ((Slabp->NodesPerSlab >= ArraySize) && (Slabp->LiveNodes == 0))
     {
       //
       // Make the previous node point to the next node.
@@ -396,11 +398,13 @@
   //
   // If the array has some space, link it into the array "free" list.
   //
-  if ((Slabp->IsManaged == 0) && (Slabp->NextFreeData != Pool->MaxNodesPerPage))
+#if 0
+  if ((Slabp->IsManaged == 1) && (Slabp->NextFreeData != Pool->MaxNodesPerPage))
   {
     Slabp->Next = Pool->ArraySlabs;
     Pool->ArraySlabs = Slabp;
   }
+#endif /* 0 */
 
   //
   // Return the list of blocks to the caller.





More information about the llvm-commits mailing list