[PATCH] D13627: [JIT] TrivialMemoryManager: Fail if we can't allocate memory
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 14 17:07:33 PDT 2015
This revision was automatically updated to reflect the committed changes.
Closed by commit rL250350: [JIT] TrivialMemoryManager: Fail if we can't allocate memory. (authored by davide).
Changed prior to commit:
http://reviews.llvm.org/D13627?vs=37043&id=37428#toc
Repository:
rL LLVM
http://reviews.llvm.org/D13627
Files:
llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp
Index: llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp
===================================================================
--- llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp
+++ llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp
@@ -181,7 +181,10 @@
unsigned Alignment,
unsigned SectionID,
StringRef SectionName) {
- sys::MemoryBlock MB = sys::Memory::AllocateRWX(Size, nullptr, nullptr);
+ std::string Err;
+ sys::MemoryBlock MB = sys::Memory::AllocateRWX(Size, nullptr, &Err);
+ if (!MB.base())
+ report_fatal_error("MemoryManager allocation failed: " + Err);
FunctionMemory.push_back(MB);
return (uint8_t*)MB.base();
}
@@ -191,7 +194,10 @@
unsigned SectionID,
StringRef SectionName,
bool IsReadOnly) {
- sys::MemoryBlock MB = sys::Memory::AllocateRWX(Size, nullptr, nullptr);
+ std::string Err;
+ sys::MemoryBlock MB = sys::Memory::AllocateRWX(Size, nullptr, &Err);
+ if (!MB.base())
+ report_fatal_error("MemoryManager allocation failed: " + Err);
DataMemory.push_back(MB);
return (uint8_t*)MB.base();
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13627.37428.patch
Type: text/x-patch
Size: 1337 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151015/2a45a100/attachment.bin>
More information about the llvm-commits
mailing list