From fa4710427fc5db4e8e27e3eeaa3dd03a65f70101 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Wed, 17 Oct 2007 22:17:01 +0000 Subject: [PATCH] ImutAVLTree now allocates tree nodes from the BumpPtrAllocator using 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 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/llvm/ADT/ImmutableSet.h b/include/llvm/ADT/ImmutableSet.h index 3ff6571481a..0210f27b895 100644 --- a/include/llvm/ADT/ImmutableSet.h +++ b/include/llvm/ADT/ImmutableSet.h @@ -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(); new (T) TreeTy(L,R,V,IncrementHeight(L,R)); - Cache.InsertNode(T,InsertPos); + return T; }