mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 21:29:20 +00:00
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:
parent
afa222c895
commit
52e2d83e65
@ -374,7 +374,7 @@ private:
|
|||||||
assert (InsertPos != NULL);
|
assert (InsertPos != NULL);
|
||||||
|
|
||||||
// Allocate the new tree node and insert it into the cache.
|
// 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));
|
new (T) TreeTy(L,R,V,IncrementHeight(L,R));
|
||||||
Cache.InsertNode(T,InsertPos);
|
Cache.InsertNode(T,InsertPos);
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ public:
|
|||||||
void *Allocate(unsigned Size, unsigned Alignment) { return malloc(Size); }
|
void *Allocate(unsigned Size, unsigned Alignment) { return malloc(Size); }
|
||||||
|
|
||||||
template <typename T>
|
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 Deallocate(void *Ptr) { free(Ptr); }
|
||||||
void PrintStats() const {}
|
void PrintStats() const {}
|
||||||
@ -48,7 +48,7 @@ public:
|
|||||||
void *Allocate(unsigned Size, unsigned Alignment);
|
void *Allocate(unsigned Size, unsigned Alignment);
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T* Allocate() {
|
void *Allocate() {
|
||||||
return reinterpret_cast<T*>(Allocate(sizeof(T),AlignOf<T>::Alignment));
|
return reinterpret_cast<T*>(Allocate(sizeof(T),AlignOf<T>::Alignment));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user