diff options
-rw-r--r-- | src/alloc/alloc_mmap/mmap_mem.cpp | 4 | ||||
-rw-r--r-- | src/utils/mlock.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/alloc/alloc_mmap/mmap_mem.cpp b/src/alloc/alloc_mmap/mmap_mem.cpp index a2059a6ea..2b27b2908 100644 --- a/src/alloc/alloc_mmap/mmap_mem.cpp +++ b/src/alloc/alloc_mmap/mmap_mem.cpp @@ -120,11 +120,11 @@ void MemoryMapping_Allocator::dealloc_block(void* ptr, u32bit n) { std::memset(ptr, PATTERNS[j], n); - if(::msync(ptr, n, MS_SYNC)) + if(::msync((char*)ptr, n, MS_SYNC)) throw MemoryMapping_Failed("Sync operation failed"); } - if(::munmap(ptr, n)) + if(::munmap((char*)ptr, n)) throw MemoryMapping_Failed("Could not unmap file"); } diff --git a/src/utils/mlock.cpp b/src/utils/mlock.cpp index bc6ddc67e..ce5ae8aed 100644 --- a/src/utils/mlock.cpp +++ b/src/utils/mlock.cpp @@ -31,7 +31,7 @@ bool has_mlock() bool lock_mem(void* ptr, u32bit bytes) { #if defined(BOTAN_TARGET_OS_HAS_POSIX_MLOCK) - return (::mlock(ptr, bytes) == 0); + return (::mlock((char*)ptr, bytes) == 0); #elif defined(BOTAN_TARGET_OS_HAS_WIN32_VIRTUAL_LOCK) return (::VirtualLock(ptr, bytes) != 0); #else @@ -45,7 +45,7 @@ bool lock_mem(void* ptr, u32bit bytes) void unlock_mem(void* ptr, u32bit bytes) { #if defined(BOTAN_TARGET_OS_HAS_POSIX_MLOCK) - ::munlock(ptr, bytes); + ::munlock((char*)ptr, bytes); #elif defined(BOTAN_TARGET_OS_HAS_WIN32_VIRTUAL_LOCK) ::VirtualUnlock(ptr, bytes); #endif |