-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
Milestone
Description
The current implementation of the DEFAULT_STACK_SIZE app property parses with a radix of 16 and is not documented anywhere, but is used by ASP.NET in ANCM scenarios. We should update the name to follow the convention and officially document the setting at https://learn.microsoft.com/dotnet/core/runtime-config/threading.
- Create a new property - Perhaps,
System.Threading.DefaultStackSize? - Document the new property at https://learn.microsoft.com/dotnet/core/runtime-config/threading
Lookup:
runtime/src/coreclr/vm/corhost.cpp
Lines 614 to 618 in cc80345
| if (u16_strcmp(pPropertyNames[i], W("DEFAULT_STACK_SIZE")) == 0) | |
| { | |
| extern void ParseDefaultStackSize(LPCWSTR value); | |
| ParseDefaultStackSize(pPropertyValues[i]); | |
| } |
Parsing:
runtime/src/coreclr/vm/threads.cpp
Lines 2045 to 2065 in cc80345
| void ParseDefaultStackSize(LPCWSTR valueStr) | |
| { | |
| if (valueStr) | |
| { | |
| LPWSTR end; | |
| errno = 0; | |
| unsigned long value = u16_strtoul(valueStr, &end, 16); // Base 16 without a prefix | |
| if ((errno == ERANGE) // Parsed value doesn't fit in an unsigned long | |
| || (valueStr == end) // No characters parsed | |
| || (end == nullptr) // Unexpected condition (should never happen) | |
| || (end[0] != 0)) // Unprocessed terminal characters | |
| { | |
| ThrowHR(E_INVALIDARG); | |
| } | |
| else | |
| { | |
| s_defaultStackSizeProperty = value; | |
| } | |
| } | |
| } |
HighPerfDotNet