mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-02 07:32:52 +00:00
Add an assertion to the fixed-size allocator to ensure that we don't request
an allocation that is greater than what we will actually allocate. Patch by Artyom Skrobov! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189340 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c59efb626a
commit
9dc1842b3f
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user