summaryrefslogtreecommitdiff
path: root/lib/Support/Unix/Memory.inc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Support/Unix/Memory.inc')
-rw-r--r--lib/Support/Unix/Memory.inc10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Support/Unix/Memory.inc b/lib/Support/Unix/Memory.inc
index 23b49b75fa..7e02244c72 100644
--- a/lib/Support/Unix/Memory.inc
+++ b/lib/Support/Unix/Memory.inc
@@ -84,7 +84,7 @@ Memory::allocateMappedMemory(size_t NumBytes,
const MemoryBlock *const NearBlock,
unsigned PFlags,
error_code &EC) {
- EC = error_code::success();
+ EC = error_code();
if (NumBytes == 0)
return MemoryBlock();
@@ -140,7 +140,7 @@ Memory::allocateMappedMemory(size_t NumBytes,
error_code
Memory::releaseMappedMemory(MemoryBlock &M) {
if (M.Address == nullptr || M.Size == 0)
- return error_code::success();
+ return error_code();
if (0 != ::munmap(M.Address, M.Size))
return error_code(errno, system_category());
@@ -148,13 +148,13 @@ Memory::releaseMappedMemory(MemoryBlock &M) {
M.Address = nullptr;
M.Size = 0;
- return error_code::success();
+ return error_code();
}
error_code
Memory::protectMappedMemory(const MemoryBlock &M, unsigned Flags) {
if (M.Address == nullptr || M.Size == 0)
- return error_code::success();
+ return error_code();
if (!Flags)
return error_code(EINVAL, generic_category());
@@ -168,7 +168,7 @@ Memory::protectMappedMemory(const MemoryBlock &M, unsigned Flags) {
if (Flags & MF_EXEC)
Memory::InvalidateInstructionCache(M.Address, M.Size);
- return error_code::success();
+ return error_code();
}
/// AllocateRWX - Allocate a slab of memory with read/write/execute