fix issue 18547 - Win32: throwing exception in fiber crashes application#2129
fix issue 18547 - Win32: throwing exception in fiber crashes application#2129dlang-bot merged 1 commit intodlang:masterfrom
Conversation
src/core/thread.d
Outdated
| * fn must not be null. | ||
| */ | ||
| this( void function() fn, size_t sz = PAGESIZE*4, | ||
| this( void function() fn, size_t sz = size_t.max, |
There was a problem hiding this comment.
Could we remove the stack size as the default value for this parameter, and add set of the constructors this (void function()/*delegate*/ fn) which will default to 8 pages or 4 pages, depending on platform. If you keep the existing approach, perhaps the documentation of these constructors should indicate default stack size?
There was a problem hiding this comment.
Could be possible, but would duplicate the number of necessary ctors and the documentation.
I was also wondering whether the default 4/8*PAGESIZE makes much sense if the system uses large pages. (I started using enum defaultStackSize just to notice that PAGESIZE is runtime-initialized).
There was a problem hiding this comment.
On second thought, maybe it is better to change the default-argument to defaultStackPages*PAGESIZE, as it is more self-documenting and does not need a magic value.
There was a problem hiding this comment.
it is better to change the default-argument to defaultStackPages*PAGESIZE
Done.
increase the default stack size because exception handling might need up to 16k. The actually used stack can depend on the version of DbgHelp.dll, the existence of debug information and possibly other conditions.
increase the default stack size because exception handling might need up to 16k. The actually used stack can depend on the version of DbgHelp.dll, the existence of debug information and possibly other conditions.