Ken Thomases : libwine: On Mac, don' t manually exclude the stack when reserving above the user space limit.

Alexandre Julliard julliard at winehq.org
Thu Mar 7 16:27:59 CST 2019


Module: wine
Branch: master
Commit: abfa6784ab3c93da6e08bbfe1f0ad8315f037ca3
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=abfa6784ab3c93da6e08bbfe1f0ad8315f037ca3

Author: Ken Thomases <ken at codeweavers.com>
Date:   Wed Mar  6 18:59:39 2019 -0600

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 <ken at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 473b22c..caa227f 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 */
 




More information about the wine-cvs mailing list