Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit e2349d8

Browse files
committed
core.thread: Fix Fiber stack size too small for ucontext_t implementation
1 parent 59546fb commit e2349d8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/core/thread/fiber.d

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -958,6 +958,13 @@ private:
958958
{
959959
version (Posix) import core.sys.posix.sys.mman; // mmap, MAP_ANON
960960

961+
static if ( __traits( compiles, ucontext_t ) )
962+
{
963+
// Stack size must be at least the minimum allowable by the OS.
964+
if (sz < MINSIGSTKSZ)
965+
sz = MINSIGSTKSZ;
966+
}
967+
961968
static if ( __traits( compiles, mmap ) )
962969
{
963970
// Allocate more for the memory guard

0 commit comments

Comments
 (0)