aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-09-11 04:31:03 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-09-11 04:31:03 +0000
commit52b0ba6873c44bd08a43f34068ffdffdb55a6f5c (patch)
tree266277fd1ccad78361ef6df1cb804ce65913f247 /lib
parent86e5aef1cebf1a3f6669b9eaaaebfdccba18d4a0 (diff)
Convert the Emitter to use the lib/System "Memory" interface instead of the
old SystemUtils.h interface to allocate RWX blocks of memory. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16286 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/ExecutionEngine/JIT/JITEmitter.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/ExecutionEngine/JIT/JITEmitter.cpp b/lib/ExecutionEngine/JIT/JITEmitter.cpp
index 5758ebc432..3ce5765cf4 100644
--- a/lib/ExecutionEngine/JIT/JITEmitter.cpp
+++ b/lib/ExecutionEngine/JIT/JITEmitter.cpp
@@ -22,7 +22,8 @@
#include "llvm/Target/TargetData.h"
#include "llvm/Support/Debug.h"
#include "llvm/ADT/Statistic.h"
-#include "llvm/Support/SystemUtils.h"
+#include "llvm/System/Memory.h"
+
using namespace llvm;
namespace {
@@ -37,6 +38,7 @@ namespace {
/// are emitting is. This never bothers to release the memory, because when
/// we are ready to destroy the JIT, the program exits.
class JITMemoryManager {
+ sys::Memory MemBlock; // Virtual memory block allocated RWX
unsigned char *MemBase; // Base of block of memory, start of stub mem
unsigned char *FunctionBase; // Start of the function body area
unsigned char *CurStubPtr, *CurFunctionPtr;
@@ -51,7 +53,8 @@ namespace {
JITMemoryManager::JITMemoryManager() {
// Allocate a 16M block of memory...
- MemBase = (unsigned char*)AllocateRWXMemory(16 << 20);
+ sys::Memory::AllocateRWX(MemBlock,(16 << 20));
+ MemBase = reinterpret_cast<unsigned char*>(MemBlock.base());
FunctionBase = MemBase + 512*1024; // Use 512k for stubs
// Allocate stubs backwards from the function base, allocate functions forward