mirror of
https://github.com/kanjitalk755/macemu.git
synced 2025-01-21 00:31:50 +00:00
Get real page size on Windows for vm_get_page_size() [64 KB]
This commit is contained in:
parent
d0fd88f7b2
commit
3a0b4ed999
@ -456,10 +456,16 @@ int vm_protect(void * addr, size_t size, int prot)
|
||||
|
||||
int vm_get_page_size(void)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
return 4096;
|
||||
#ifdef HAVE_WIN32_VM
|
||||
static unsigned long page_size = 0;
|
||||
if (page_size == 0) {
|
||||
SYSTEM_INFO si;
|
||||
GetSystemInfo(&si);
|
||||
page_size = si.dwAllocationGranularity;
|
||||
}
|
||||
return page_size;
|
||||
#else
|
||||
return getpagesize();
|
||||
return getpagesize();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user