diff mbox series

[committed] libphobos: Increase size of defaultStackPages on OSX X86_64 targets.

Message ID 20211119140656.3119175-1-ibuclaw@gdcproject.org
State New
Headers show
Series [committed] libphobos: Increase size of defaultStackPages on OSX X86_64 targets. | expand

Commit Message

Iain Buclaw Nov. 19, 2021, 2:06 p.m. UTC
Hi,

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.

Regression tested on x86_64-linux-gnu and x86_64-apple-darwin20,
committed to mainline and backported to the release branches.

Regards,
Iain.

---
libphobos/ChangeLog:

	* libdruntime/core/thread/fiber.d (defaultStackPages): Increase size
	on OSX X86_64 targets.
---
 libphobos/libdruntime/core/thread/fiber.d | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/libphobos/libdruntime/core/thread/fiber.d b/libphobos/libdruntime/core/thread/fiber.d
index f4c04ce7358..2f90f179edb 100644
--- a/libphobos/libdruntime/core/thread/fiber.d
+++ b/libphobos/libdruntime/core/thread/fiber.d
@@ -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;