ImutAVLTree now allocates tree nodes from the BumpPtrAllocator using
authorTed Kremenek <kremenek@apple.com>
Wed, 17 Oct 2007 22:17:01 +0000 (22:17 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 17 Oct 2007 22:17:01 +0000 (22:17 +0000)
the new type-aligned Allocate() method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43100 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/ImmutableSet.h

index 3ff6571481ad0fd4b2f90de6f818a885e4913c13..0210f27b895f4341b00ffcedc602f688c688a1db 100644 (file)
@@ -373,12 +373,11 @@ private:
     
     assert (InsertPos != NULL);
     
-    // FIXME: more intelligent calculation of alignment.
-    TreeTy* T = (TreeTy*) Allocator.Allocate(sizeof(*T),16);
-    
+    // Allocate the new tree node and insert it into the cache.
+    TreeTy* T = Allocator.Allocate<TreeTy>();    
     new (T) TreeTy(L,R,V,IncrementHeight(L,R));
-    
     Cache.InsertNode(T,InsertPos);
+
     return T;      
   }