Changed the return type of type-specific Allocate() methods to return

void*.  This is hint that we are returning uninitialized memory rather
than a constructed object.

Patched ImutAVLTree to conform to this new interface.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43106 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Ted Kremenek 2007-10-18 00:30:14 +00:00
parent afa222c895
commit 52e2d83e65
2 changed files with 3 additions and 3 deletions

View File

@ -374,7 +374,7 @@ private:
assert (InsertPos != NULL);
// Allocate the new tree node and insert it into the cache.
TreeTy* T = Allocator.Allocate<TreeTy>();
TreeTy* T = (TreeTy*) Allocator.Allocate<TreeTy>();
new (T) TreeTy(L,R,V,IncrementHeight(L,R));
Cache.InsertNode(T,InsertPos);

View File

@ -28,7 +28,7 @@ public:
void *Allocate(unsigned Size, unsigned Alignment) { return malloc(Size); }
template <typename T>
T* Allocate() { return reinterpret_cast<T*>(malloc(sizeof(T))); }
void *Allocate() { return reinterpret_cast<T*>(malloc(sizeof(T))); }
void Deallocate(void *Ptr) { free(Ptr); }
void PrintStats() const {}
@ -48,7 +48,7 @@ public:
void *Allocate(unsigned Size, unsigned Alignment);
template <typename T>
T* Allocate() {
void *Allocate() {
return reinterpret_cast<T*>(Allocate(sizeof(T),AlignOf<T>::Alignment));
}