X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FSupport%2FRecyclingAllocator.h;h=34ab874778c912bc7fba98459c5fd0f189138509;hb=5df15c692b944b6c46ec6d532fc286b7e0000d5d;hp=8e957f1b26453de00b74c4821e0439d495941120;hpb=fed90b6d097d50881afb45e4d79f430db66dd741;p=oota-llvm.git diff --git a/include/llvm/Support/RecyclingAllocator.h b/include/llvm/Support/RecyclingAllocator.h index 8e957f1b264..34ab874778c 100644 --- a/include/llvm/Support/RecyclingAllocator.h +++ b/include/llvm/Support/RecyclingAllocator.h @@ -41,7 +41,7 @@ public: /// SubClass. The storage may be either newly allocated or recycled. /// template - SubClass *Allocate() { return Base.Allocate(Allocator); } + SubClass *Allocate() { return Base.template Allocate(Allocator); } T *Allocate() { return Base.Allocate(Allocator); } @@ -56,4 +56,18 @@ public: } +template +inline void *operator new(size_t, + llvm::RecyclingAllocator &Allocator) { + return Allocator.Allocate(); +} + +template +inline void operator delete(void *E, + llvm::RecyclingAllocator &A) { + A.Deallocate(E); +} + #endif