]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libphobos: Increase size of defaultStackPages on OSX X86_64 targets.
authorIain Buclaw <ibuclaw@gdcproject.org>
Fri, 19 Nov 2021 13:43:07 +0000 (14:43 +0100)
committerIain Buclaw <ibuclaw@gdcproject.org>
Fri, 19 Nov 2021 13:43:07 +0000 (14:43 +0100)
As of macOS 11, libunwind now requires more stack space than 16k, so
default to a larger stack size. This is only applied to X86 as the
PAGESIZE is still 4k, however on AArch64 it is 16k.

libphobos/ChangeLog:

* libdruntime/core/thread/fiber.d (defaultStackPages): Increase size
on OSX X86_64 targets.

libphobos/libdruntime/core/thread/fiber.d

index f4c04ce73581d2ed3589d82eaf71076534f1159c..2f90f179edb8c80ca6110b707b15b126995e5e29 100644 (file)
@@ -595,6 +595,16 @@ class Fiber
         // the existence of debug symbols and other conditions. Avoid causing
         // stack overflows by defaulting to a larger stack size
         enum defaultStackPages = 8;
+    else version (OSX)
+    {
+        version (X86_64)
+            // libunwind on macOS 11 now requires more stack space than 16k, so
+            // default to a larger stack size. This is only applied to X86 as
+            // the PAGESIZE is still 4k, however on AArch64 it is 16k.
+            enum defaultStackPages = 8;
+        else
+            enum defaultStackPages = 4;
+    }
     else
         enum defaultStackPages = 4;