Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
/ druntime Public archive
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/core/thread.d
Original file line number Diff line number Diff line change
Expand Up @@ -4071,6 +4071,14 @@ class Fiber
// Initialization
///////////////////////////////////////////////////////////////////////////

version(Windows)
// exception handling walks the stack, invoking DbgHelp.dll which
// needs up to 16k of stack space depending on the version of DbgHelp.dll,
// the existence of debug symbols and other conditions. Avoid causing
// stack overflows by defaulting to a larger stack size
enum defaultStackPages = 8;
else
enum defaultStackPages = 4;

/**
* Initializes a fiber object which is associated with a static
Expand All @@ -4087,7 +4095,7 @@ class Fiber
* In:
* fn must not be null.
*/
this( void function() fn, size_t sz = PAGESIZE*4,
this( void function() fn, size_t sz = PAGESIZE * defaultStackPages,
size_t guardPageSize = PAGESIZE ) nothrow
in
{
Expand Down Expand Up @@ -4115,15 +4123,15 @@ class Fiber
* In:
* dg must not be null.
*/
this( void delegate() dg, size_t sz = PAGESIZE*4,
this( void delegate() dg, size_t sz = PAGESIZE * defaultStackPages,
size_t guardPageSize = PAGESIZE ) nothrow
in
{
assert( dg );
}
do
{
allocStack( sz, guardPageSize);
allocStack( sz, guardPageSize );
reset( dg );
}

Expand Down