From: Fabian Maurer dark.shadow4@web.de
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52715 --- dlls/ntdll/unix/virtual.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index c6cfd7a9fa2..77cff772584 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -153,8 +153,8 @@ static struct wine_rb_tree views_tree; static pthread_mutex_t virtual_mutex;
SIZE_T page_size; -static const UINT page_shift = 12; -static const UINT_PTR page_mask = 0xfff; +static UINT page_shift; +static UINT_PTR page_mask; static const UINT_PTR granularity_mask = 0xffff;
/* Note: these are Windows limits, you cannot change them. */ @@ -3246,6 +3246,13 @@ static void *alloc_virtual_heap( SIZE_T size ) return anon_mmap_alloc( size, PROT_READ | PROT_WRITE ); }
+static UINT get_page_shift(SIZE_T page_size) +{ + UINT ret = 0; + while (page_size >>= 1) ret++; + return ret; +} + /*********************************************************************** * virtual_init */ @@ -3258,6 +3265,8 @@ void virtual_init(void) pthread_mutexattr_t attr;
page_size = getpagesize(); + page_shift = get_page_shift(page_size); + page_mask = page_size - 1;
pthread_mutexattr_init( &attr ); pthread_mutexattr_settype( &attr, PTHREAD_MUTEX_RECURSIVE );