summaryrefslogtreecommitdiffstats
path: root/llvm/lib/System/Unix
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2009-07-23 00:49:59 +0000
committerReid Kleckner <reid@kleckner.net>2009-07-23 00:49:59 +0000
commit1a722d9b7306b9c14250bb6c86f104dc6bbfdded (patch)
tree73133062326a4574451485d682736eebb6f5970f /llvm/lib/System/Unix
parent0228bc1a41fbd2b3cfecd05d6518bb424c9c34b4 (diff)
downloadbcm5719-llvm-1a722d9b7306b9c14250bb6c86f104dc6bbfdded.tar.gz
bcm5719-llvm-1a722d9b7306b9c14250bb6c86f104dc6bbfdded.zip
Make the JIT code emitter properly retry and ask for more memory when it runs
out of memory, and also make the default memory manager allocate more memory when it runs out. Also, switch function stubs and global data over to using the BumpPtrAllocator. This makes it so the JIT no longer mmaps (or the equivalent on Windows) 16 MB of memory, and instead allocates in 512K slabs. I suspect this size could go lower, especially on embedded platforms, now that more slabs can be allocated. llvm-svn: 76828
Diffstat (limited to 'llvm/lib/System/Unix')
-rw-r--r--llvm/lib/System/Unix/Memory.inc7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/System/Unix/Memory.inc b/llvm/lib/System/Unix/Memory.inc
index b7a70135bcb..a80f56fbc14 100644
--- a/llvm/lib/System/Unix/Memory.inc
+++ b/llvm/lib/System/Unix/Memory.inc
@@ -12,6 +12,7 @@
//===----------------------------------------------------------------------===//
#include "Unix.h"
+#include "llvm/Support/DataTypes.h"
#include "llvm/System/Process.h"
#ifdef HAVE_SYS_MMAN_H
@@ -28,12 +29,12 @@
/// is very OS specific.
///
llvm::sys::MemoryBlock
-llvm::sys::Memory::AllocateRWX(unsigned NumBytes, const MemoryBlock* NearBlock,
+llvm::sys::Memory::AllocateRWX(size_t NumBytes, const MemoryBlock* NearBlock,
std::string *ErrMsg) {
if (NumBytes == 0) return MemoryBlock();
- unsigned pageSize = Process::GetPageSize();
- unsigned NumPages = (NumBytes+pageSize-1)/pageSize;
+ size_t pageSize = Process::GetPageSize();
+ size_t NumPages = (NumBytes+pageSize-1)/pageSize;
int fd = -1;
#ifdef NEED_DEV_ZERO_FOR_MMAP
OpenPOWER on IntegriCloud