diff options
author | Nicolas Geoffray <nicolas.geoffray@lip6.fr> | 2009-07-29 22:55:02 +0000 |
---|---|---|
committer | Nicolas Geoffray <nicolas.geoffray@lip6.fr> | 2009-07-29 22:55:02 +0000 |
commit | 956a86445cf8cd2961c42f2a3a47baefd7ed8533 (patch) | |
tree | 40ecfbbf7f44847586e1f4b939a4231611445aa4 /llvm/lib/ExecutionEngine/JIT/JITMemoryManager.cpp | |
parent | 47d02732e082e468dff1a96a925d38eebd7a1bb1 (diff) | |
download | bcm5719-llvm-956a86445cf8cd2961c42f2a3a47baefd7ed8533.tar.gz bcm5719-llvm-956a86445cf8cd2961c42f2a3a47baefd7ed8533.zip |
In TrimAllocationToSize, if a block is below the minimum allocation size,
there is no new block added to the free list. Therefore on the next
startFunctionBody call, a new slab must be allocated.
llvm-svn: 77520
Diffstat (limited to 'llvm/lib/ExecutionEngine/JIT/JITMemoryManager.cpp')
-rw-r--r-- | llvm/lib/ExecutionEngine/JIT/JITMemoryManager.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/ExecutionEngine/JIT/JITMemoryManager.cpp b/llvm/lib/ExecutionEngine/JIT/JITMemoryManager.cpp index 2d64fcfa490..3f38f9c241a 100644 --- a/llvm/lib/ExecutionEngine/JIT/JITMemoryManager.cpp +++ b/llvm/lib/ExecutionEngine/JIT/JITMemoryManager.cpp @@ -351,9 +351,12 @@ namespace { iter = iter->Next; } + largest = largest - sizeof(MemoryRangeHeader); + // If this block isn't big enough for the allocation desired, allocate // another block of memory and add it to the free list. - if (largest - sizeof(MemoryRangeHeader) < ActualSize) { + if (largest < ActualSize || + largest <= FreeRangeHeader::getMinBlockSize()) { DOUT << "JIT: Allocating another slab of memory for function."; candidateBlock = allocateNewCodeSlab((size_t)ActualSize); } |