diff options
| author | Reid Kleckner <reid@kleckner.net> | 2009-07-23 00:49:59 +0000 |
|---|---|---|
| committer | Reid Kleckner <reid@kleckner.net> | 2009-07-23 00:49:59 +0000 |
| commit | 8878ad2cbbc1af6917fb3f2cfad1fa8e9b5aa119 (patch) | |
| tree | 05ebfa127cf6703aeb1d5fd3001ada1823379973 /include/llvm/System | |
| parent | e672dc2856f6334d4d218e260e3aae04ab97909c (diff) | |
| download | external_llvm-8878ad2cbbc1af6917fb3f2cfad1fa8e9b5aa119.zip external_llvm-8878ad2cbbc1af6917fb3f2cfad1fa8e9b5aa119.tar.gz external_llvm-8878ad2cbbc1af6917fb3f2cfad1fa8e9b5aa119.tar.bz2 | |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76828 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/System')
| -rw-r--r-- | include/llvm/System/Memory.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/llvm/System/Memory.h b/include/llvm/System/Memory.h index 136dc8a..d6300db 100644 --- a/include/llvm/System/Memory.h +++ b/include/llvm/System/Memory.h @@ -14,6 +14,7 @@ #ifndef LLVM_SYSTEM_MEMORY_H #define LLVM_SYSTEM_MEMORY_H +#include "llvm/Support/DataTypes.h" #include <string> namespace llvm { @@ -26,11 +27,13 @@ namespace sys { /// @brief Memory block abstraction. class MemoryBlock { public: + MemoryBlock() { } + MemoryBlock(void *addr, size_t size) : Address(addr), Size(size) { } void *base() const { return Address; } - unsigned size() const { return Size; } + size_t size() const { return Size; } private: void *Address; ///< Address of first byte of memory area - unsigned Size; ///< Size, in bytes of the memory area + size_t Size; ///< Size, in bytes of the memory area friend class Memory; }; @@ -50,7 +53,7 @@ namespace sys { /// a null memory block and fills in *ErrMsg. /// /// @brief Allocate Read/Write/Execute memory. - static MemoryBlock AllocateRWX(unsigned NumBytes, + static MemoryBlock AllocateRWX(size_t NumBytes, const MemoryBlock *NearBlock, std::string *ErrMsg = 0); |
