diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-07-29 07:38:32 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-07-29 07:38:32 +0000 |
commit | 60b75f462e1044a031fbd75a8dcb45cb3de29177 (patch) | |
tree | 45cfc3c88180efcc7fa71d1603547283532fec0c /lib/ExecutionEngine | |
parent | 7ba145b0b4aefe6cae7788070a936cb9fc0aee14 (diff) | |
download | external_llvm-60b75f462e1044a031fbd75a8dcb45cb3de29177.zip external_llvm-60b75f462e1044a031fbd75a8dcb45cb3de29177.tar.gz external_llvm-60b75f462e1044a031fbd75a8dcb45cb3de29177.tar.bz2 |
Fix for PR2578. Do not split off a block whose size is less than FreeRangeHeader::getMinBlockSize(). Patch by Damien.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54152 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine')
-rw-r--r-- | lib/ExecutionEngine/JIT/JITMemoryManager.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/ExecutionEngine/JIT/JITMemoryManager.cpp b/lib/ExecutionEngine/JIT/JITMemoryManager.cpp index 4cbfcf9..2482916 100644 --- a/lib/ExecutionEngine/JIT/JITMemoryManager.cpp +++ b/lib/ExecutionEngine/JIT/JITMemoryManager.cpp @@ -202,6 +202,9 @@ TrimAllocationToSize(FreeRangeHeader *FreeList, uint64_t NewSize) { assert(ThisAllocated && getBlockAfter().PrevAllocated && "Cannot deallocate part of an allocated block!"); + // Don't allow blocks to be trimmed below minimum required size + NewSize = std::max<uint64_t>(FreeRangeHeader::getMinBlockSize(), NewSize); + // Round up size for alignment of header. unsigned HeaderAlign = __alignof(FreeRangeHeader); NewSize = (NewSize+ (HeaderAlign-1)) & ~(HeaderAlign-1); |