Skip to content

Commit 66cacf0

Browse files
Delete DEFAULT_STACK_SIZE
dotnet#110455 (comment)
1 parent e1d6402 commit 66cacf0

File tree

2 files changed

+1
-33
lines changed

2 files changed

+1
-33
lines changed

src/coreclr/vm/corhost.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -608,12 +608,6 @@ HRESULT CorHost2::CreateAppDomainWithManager(
608608
pwzAppPaths = pPropertyValues[i];
609609
}
610610
else
611-
if (u16_strcmp(pPropertyNames[i], W("DEFAULT_STACK_SIZE")) == 0)
612-
{
613-
extern void ParseDefaultStackSize(LPCWSTR value);
614-
ParseDefaultStackSize(pPropertyValues[i]);
615-
}
616-
else
617611
if (u16_strcmp(pPropertyNames[i], W("USE_ENTRYPOINT_FILTER")) == 0)
618612
{
619613
extern void ParseUseEntryPointFilter(LPCWSTR value);

src/coreclr/vm/threads.cpp

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2052,38 +2052,12 @@ HANDLE Thread::CreateUtilityThread(Thread::StackSizeBucket stackSizeBucket, LPTH
20522052
return hThread;
20532053
}
20542054

2055-
// Represent the value of DEFAULT_STACK_SIZE as passed in the property bag to the host during construction
2056-
static unsigned long s_defaultStackSizeProperty = 0;
2057-
2058-
void ParseDefaultStackSize(LPCWSTR valueStr)
2059-
{
2060-
if (valueStr)
2061-
{
2062-
LPWSTR end;
2063-
errno = 0;
2064-
unsigned long value = u16_strtoul(valueStr, &end, 16); // Base 16 without a prefix
2065-
2066-
if ((errno == ERANGE) // Parsed value doesn't fit in an unsigned long
2067-
|| (valueStr == end) // No characters parsed
2068-
|| (end == nullptr) // Unexpected condition (should never happen)
2069-
|| (end[0] != 0)) // Unprocessed terminal characters
2070-
{
2071-
ThrowHR(E_INVALIDARG);
2072-
}
2073-
else
2074-
{
2075-
s_defaultStackSizeProperty = value;
2076-
}
2077-
}
2078-
}
2079-
20802055
SIZE_T GetDefaultStackSizeSetting()
20812056
{
20822057
static DWORD s_defaultStackSizeEnv = CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_Thread_DefaultStackSize);
20832058
static DWORD s_defaultStackSizeProp = Configuration::GetKnobDWORDValue(W("System.Threading.DefaultStackSize"), 0);
20842059

2085-
uint64_t value = s_defaultStackSizeEnv ? s_defaultStackSizeEnv
2086-
: (s_defaultStackSizeProperty ? s_defaultStackSizeProperty : s_defaultStackSizeProp);
2060+
uint64_t value = s_defaultStackSizeEnv ? s_defaultStackSizeEnv : s_defaultStackSizeProp;
20872061

20882062
SIZE_T minStack = 0x10000; // 64K - Somewhat arbitrary minimum thread stack size
20892063
SIZE_T maxStack = 0x80000000; // 2G - Somewhat arbitrary maximum thread stack size

0 commit comments

Comments
 (0)