mirror of
https://github.com/kanjitalk755/macemu.git
synced 2024-12-25 02:29:49 +00:00
- vm_acquire_fixed: Fix memset() and vm_protect() calls so that the address
is really the one specified instead of always zero.
This commit is contained in:
parent
7627f346ee
commit
2f652a42e5
@ -136,7 +136,7 @@ int vm_acquire_fixed(void * addr, size_t size)
|
||||
return -1;
|
||||
|
||||
// Since I don't know the standard behavior of mmap(), zero-fill here
|
||||
if (memset(0, 0, size) != 0)
|
||||
if (memset(addr, 0, size) != 0)
|
||||
return -1;
|
||||
#else
|
||||
// Unsupported
|
||||
@ -146,7 +146,7 @@ int vm_acquire_fixed(void * addr, size_t size)
|
||||
|
||||
// Explicitely protect the newly mapped region here because on some systems,
|
||||
// say MacOS X, mmap() doesn't honour the requested protection flags.
|
||||
if (vm_protect(0, size, VM_PAGE_DEFAULT) != 0)
|
||||
if (vm_protect(addr, size, VM_PAGE_DEFAULT) != 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user