mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-31 10:34:17 +00:00
Used mapWindowsError. I missed these in the initial transition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210729 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e964d1d6dd
commit
5ac7ab395a
@ -15,6 +15,7 @@
|
|||||||
#include "llvm/Support/DataTypes.h"
|
#include "llvm/Support/DataTypes.h"
|
||||||
#include "llvm/Support/ErrorHandling.h"
|
#include "llvm/Support/ErrorHandling.h"
|
||||||
#include "llvm/Support/Process.h"
|
#include "llvm/Support/Process.h"
|
||||||
|
#include "llvm/Support/WindowsError.h"
|
||||||
|
|
||||||
// The Windows.h header must be the last one included.
|
// The Windows.h header must be the last one included.
|
||||||
#include "WindowsSupport.h"
|
#include "WindowsSupport.h"
|
||||||
@ -99,7 +100,7 @@ MemoryBlock Memory::allocateMappedMemory(size_t NumBytes,
|
|||||||
// Try again without the NearBlock hint
|
// Try again without the NearBlock hint
|
||||||
return allocateMappedMemory(NumBytes, NULL, Flags, EC);
|
return allocateMappedMemory(NumBytes, NULL, Flags, EC);
|
||||||
}
|
}
|
||||||
EC = error_code(::GetLastError(), system_category());
|
EC = mapWindowsError(::GetLastError());
|
||||||
return MemoryBlock();
|
return MemoryBlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -118,7 +119,7 @@ error_code Memory::releaseMappedMemory(MemoryBlock &M) {
|
|||||||
return error_code();
|
return error_code();
|
||||||
|
|
||||||
if (!VirtualFree(M.Address, 0, MEM_RELEASE))
|
if (!VirtualFree(M.Address, 0, MEM_RELEASE))
|
||||||
return error_code(::GetLastError(), system_category());
|
return mapWindowsError(::GetLastError());
|
||||||
|
|
||||||
M.Address = 0;
|
M.Address = 0;
|
||||||
M.Size = 0;
|
M.Size = 0;
|
||||||
@ -135,7 +136,7 @@ error_code Memory::protectMappedMemory(const MemoryBlock &M,
|
|||||||
|
|
||||||
DWORD OldFlags;
|
DWORD OldFlags;
|
||||||
if (!VirtualProtect(M.Address, M.Size, Protect, &OldFlags))
|
if (!VirtualProtect(M.Address, M.Size, Protect, &OldFlags))
|
||||||
return error_code(::GetLastError(), system_category());
|
return mapWindowsError(::GetLastError());
|
||||||
|
|
||||||
if (Flags & MF_EXEC)
|
if (Flags & MF_EXEC)
|
||||||
Memory::InvalidateInstructionCache(M.Address, M.Size);
|
Memory::InvalidateInstructionCache(M.Address, M.Size);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user