llvm.org GIT mirror llvm / 191dfcf
Add a comment, and fix a bug where AllocateRW recurred to AllocateRWX instead of itself. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48677 91177308-0d34-0410-b5e6-96231b3b80d8 Owen Anderson 12 years ago
2 changed file(s) with 9 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
5656 const MemoryBlock *NearBlock,
5757 std::string *ErrMsg = 0);
5858
59 /// This method allocates a block of Read/Write memory. This memory
60 /// needs to have executable permissions set before it can be used
61 /// to execute JIT'ed code.
62 ///
63 /// On success, this returns a non-null memory block, otherwise it returns
64 /// a null memory block and fills in *ErrMsg.
65 ///
66 /// @brief Allocate Read/Write/Execute memory.
5967 static MemoryBlock AllocateRW(unsigned NumBytes,
6068 const MemoryBlock *NearBlock,
6169 std::string *ErrMsg = 0);
102102 flags, fd, 0);
103103 if (pa == MAP_FAILED) {
104104 if (NearBlock) //Try again without a near hint
105 return AllocateRWX(NumBytes, 0);
105 return AllocateRW(NumBytes, 0);
106106
107107 MakeErrMsg(ErrMsg, "Can't allocate RWX Memory");
108108 return MemoryBlock();