From abfa6784ab3c93da6e08bbfe1f0ad8315f037ca3 Mon Sep 17 00:00:00 2001 From: Ken Thomases Date: Wed, 6 Mar 2019 18:59:39 -0600 Subject: [PATCH] libwine: On Mac, don't manually exclude the stack when reserving above the user space limit. Since we don't rely on trial and error, there's no advantage to this heuristic. Signed-off-by: Ken Thomases Signed-off-by: Alexandre Julliard --- libs/wine/mmap.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libs/wine/mmap.c b/libs/wine/mmap.c index 473b22c8922..caa227f990c 100644 --- a/libs/wine/mmap.c +++ b/libs/wine/mmap.c @@ -55,7 +55,9 @@ struct reserved_area }; static struct list reserved_areas = LIST_INIT(reserved_areas); +#ifndef __APPLE__ static const unsigned int granularity_mask = 0xffff; /* reserved areas have 64k granularity */ +#endif #ifndef MAP_NORESERVE #define MAP_NORESERVE 0 @@ -419,8 +421,10 @@ void mmap_init(void) #ifdef __i386__ struct reserved_area *area; struct list *ptr; +#ifndef __APPLE__ char stack; char * const stack_ptr = &stack; +#endif char *user_space_limit = (char *)0x7ffe0000; reserve_malloc_space( 8 * 1024 * 1024 ); @@ -444,6 +448,7 @@ void mmap_init(void) } } +#ifndef __APPLE__ if (stack_ptr >= user_space_limit) { char *end = 0; @@ -457,7 +462,9 @@ void mmap_init(void) #endif reserve_area( base, end ); } - else reserve_area( user_space_limit, 0 ); + else +#endif + reserve_area( user_space_limit, 0 ); /* reserve the DOS area if not already done */