Skip to content

Officially document and update the DEFAULT_STACK_SIZE app property #113344

Open
@AaronRobinsonMSFT

Description

@AaronRobinsonMSFT

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.

Lookup:

if (u16_strcmp(pPropertyNames[i], W("DEFAULT_STACK_SIZE")) == 0)
{
extern void ParseDefaultStackSize(LPCWSTR value);
ParseDefaultStackSize(pPropertyValues[i]);
}

Parsing:

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;
}
}
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions