aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Support/RecyclingAllocator.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Support/RecyclingAllocator.h')
-rw-r--r--include/llvm/Support/RecyclingAllocator.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/llvm/Support/RecyclingAllocator.h b/include/llvm/Support/RecyclingAllocator.h
index f67503f..001d1cf 100644
--- a/include/llvm/Support/RecyclingAllocator.h
+++ b/include/llvm/Support/RecyclingAllocator.h
@@ -60,9 +60,10 @@ public:
}
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();
}