diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2013-12-22 00:04:03 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2013-12-22 00:04:03 +0000 |
commit | f8af5cf600354830d4ccf59732403f0f073eccb9 (patch) | |
tree | 2ba0398b4c42ad4f55561327538044fd2c925a8b /include/llvm/Support/RecyclingAllocator.h | |
parent | 59d6cff90eecf31cb3dd860c4e786674cfdd42eb (diff) |
Diffstat (limited to 'include/llvm/Support/RecyclingAllocator.h')
-rw-r--r-- | include/llvm/Support/RecyclingAllocator.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/llvm/Support/RecyclingAllocator.h b/include/llvm/Support/RecyclingAllocator.h index 34ab874778c91..001d1cf7c3df2 100644 --- a/include/llvm/Support/RecyclingAllocator.h +++ b/include/llvm/Support/RecyclingAllocator.h @@ -51,15 +51,19 @@ public: template<class SubClass> void Deallocate(SubClass* E) { return Base.Deallocate(Allocator, E); } - void PrintStats() { Base.PrintStats(); } + void PrintStats() { + Allocator.PrintStats(); + Base.PrintStats(); + } }; } template<class AllocatorType, class T, size_t Size, size_t Align> -inline void *operator new(size_t, +inline void *operator new(size_t size, llvm::RecyclingAllocator<AllocatorType, T, Size, Align> &Allocator) { + assert(size <= Size && "allocation size exceeded"); return Allocator.Allocate(); } |