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

John Criswell criswell at cs.uiuc.edu
Fri May 27 13:22:23 PDT 2005



Changes in directory llvm-poolalloc/runtime/FL2Allocator:

PoolAllocator.cpp updated: 1.48 -> 1.49
---
Log message:

When creating a new pointer compression pool, stagger the beginning of the
pool by an extra node.
This has the effect of ensuring that pools can be aligned on different
page boundaries, reducing cache conflicts (in theory).


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

 PoolAllocator.cpp |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletion(-)


Index: llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.cpp
diff -u llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.cpp:1.48 llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.cpp:1.49
--- llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.cpp:1.48	Wed May 18 14:56:30 2005
+++ llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.cpp	Fri May 27 15:21:35 2005
@@ -883,6 +883,8 @@
                   unsigned DeclaredSize, unsigned ObjAlignment) {
   poolinit_internal(Pool, DeclaredSize, ObjAlignment);
 
+  static int count=0;
+
   // Create the pool.  We have to do this eagerly (instead of on the first
   // allocation), because code may want to eagerly copy the pool base into a
   // register.
@@ -898,7 +900,11 @@
   if (Pool->Slabs == 0) {
     // Didn't find an existing pool, create one.
     Pool->Slabs = (PoolSlab<CompressedPoolTraits>*)
-                      AllocateSpaceWithMMAP(POOLSIZE, true);
+                      AllocateSpaceWithMMAP(POOLSIZE + (DeclaredSize * count), true);
+    Pool->Slabs += (DeclaredSize * count);
+#if 1
+    count++;
+#endif
     DO_IF_TRACE(fprintf(stderr, "RESERVED ADDR SPACE: %p -> %p\n",
                         Pool->Slabs, (char*)Pool->Slabs+POOLSIZE));
   }






More information about the llvm-commits mailing list