diff options
author | Andrew Lenharth <andrewl@lenharth.org> | 2005-07-29 23:40:16 +0000 |
---|---|---|
committer | Andrew Lenharth <andrewl@lenharth.org> | 2005-07-29 23:40:16 +0000 |
commit | 0940218ccaba85b05825bacd4a1b187c3595be3e (patch) | |
tree | 2df0ca9f6e70b7873f925b4454e5a51f958cd986 /llvm/lib/System/Win32/Memory.inc | |
parent | 2f9c52e194a4dc0155879c80bff29f6c9c7aa7ed (diff) | |
download | bcm5719-llvm-0940218ccaba85b05825bacd4a1b187c3595be3e.tar.gz bcm5719-llvm-0940218ccaba85b05825bacd4a1b187c3595be3e.zip |
support near allocations for the JIT
llvm-svn: 22554
Diffstat (limited to 'llvm/lib/System/Win32/Memory.inc')
-rw-r--r-- | llvm/lib/System/Win32/Memory.inc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/System/Win32/Memory.inc b/llvm/lib/System/Win32/Memory.inc index 9ebef6a71a3..7e93dee24eb 100644 --- a/llvm/lib/System/Win32/Memory.inc +++ b/llvm/lib/System/Win32/Memory.inc @@ -23,12 +23,14 @@ using namespace sys; //=== and must not be UNIX code //===----------------------------------------------------------------------===// -MemoryBlock Memory::AllocateRWX(unsigned NumBytes) { +MemoryBlock Memory::AllocateRWX(unsigned NumBytes, const MemoryBlock* NearBlock) { if (NumBytes == 0) return MemoryBlock(); static const long pageSize = Process::GetPageSize(); unsigned NumPages = (NumBytes+pageSize-1)/pageSize; + //FIXME: support NearBlock if ever needed on Win64. + void *pa = VirtualAlloc(NULL, NumPages*pageSize, MEM_COMMIT, PAGE_EXECUTE_READWRITE); if (pa == NULL) { |