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

Andrew Lenharth alenhar2 at cs.uiuc.edu
Wed Jun 14 14:17:47 PDT 2006



Changes in directory llvm-poolalloc/runtime/FreeListAllocator:

PoolAllocator.cpp updated: 1.34 -> 1.35
PoolSlab.h updated: 1.6 -> 1.7
---
Log message:

Fix compile problems

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

 PoolAllocator.cpp |    5 ++---
 PoolSlab.h        |    3 ++-
 2 files changed, 4 insertions(+), 4 deletions(-)


Index: llvm-poolalloc/runtime/FreeListAllocator/PoolAllocator.cpp
diff -u llvm-poolalloc/runtime/FreeListAllocator/PoolAllocator.cpp:1.34 llvm-poolalloc/runtime/FreeListAllocator/PoolAllocator.cpp:1.35
--- llvm-poolalloc/runtime/FreeListAllocator/PoolAllocator.cpp:1.34	Wed May 18 14:56:31 2005
+++ llvm-poolalloc/runtime/FreeListAllocator/PoolAllocator.cpp	Wed Jun 14 16:17:32 2006
@@ -99,7 +99,6 @@
       NodesPerSlab = MaxNodesPerPage;
     }
   }
-
   NewSlab->NodesPerSlab = NodesPerSlab;
   NewSlab->NextFreeData = NewSlab->LiveNodes = 0;
   NewSlab->Next = NULL;
@@ -413,7 +412,7 @@
   //
   // Find the data block that corresponds with this pointer.
   //
-  Data = (Slabp->Data + (Pool->NodeSize * (Pool->FreeList.Next - &(Slabp->BlockList[0]))));
+  Data = (Slabp->Data + (Pool->NodeSize * (Pool->FreeList.Next - &(BlockList(Slabp)[0]))));
 
   //
   // Unlink the first block.
@@ -451,7 +450,7 @@
   // Find the node pointer that corresponds to this data block.
   //
   NodePointer Node;
-  Node.Next = &(slabp->BlockList[((unsigned char *)Block - slabp->Data)/Pool->NodeSize]);
+  Node.Next = &(BlockList(slabp)[((unsigned char *)Block - slabp->Data)/Pool->NodeSize]);
 
   //
   // Add the node back to the free list.


Index: llvm-poolalloc/runtime/FreeListAllocator/PoolSlab.h
diff -u llvm-poolalloc/runtime/FreeListAllocator/PoolSlab.h:1.6 llvm-poolalloc/runtime/FreeListAllocator/PoolSlab.h:1.7
--- llvm-poolalloc/runtime/FreeListAllocator/PoolSlab.h:1.6	Wed May 18 14:56:32 2005
+++ llvm-poolalloc/runtime/FreeListAllocator/PoolSlab.h	Wed Jun 14 16:17:33 2006
@@ -73,7 +73,8 @@
   unsigned char * Data;
 
   // Pointer to the list of nodes
-  NodePointer BlockList [];
+  //NodePointer* BlockList;
 };
+#define BlockList(x) ((NodePointer*)((char*)x + sizeof(SlabHeader)))
 
 #endif /* _POOLSLAB_H */






More information about the llvm-commits mailing list