Author: kremenek
Date: Wed Oct 17 17:17:01 2007
New Revision: 43100
URL: http://llvm.org/viewvc/llvm-project?rev=43100&view=rev
Log:
ImutAVLTree now allocates tree nodes from the BumpPtrAllocator using
the new type-aligned Allocate() method.
Modified:
llvm/trunk/include/llvm/ADT/ImmutableSet.h
Modified: llvm/trunk/include/llvm/ADT/ImmutableSet.h
URL:
http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ImmutableSet.h?rev=43100&r1=43099&r2=43100&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/ImmutableSet.h (original)
+++ llvm/trunk/include/llvm/ADT/ImmutableSet.h Wed Oct 17 17:17:01 2007
@@ -373,12 +373,11 @@
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;
}
_______________________________________________
llvm-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits