Skip to content

Are !UseThreadAllocationContexts branches relevant? #115102

Open
@am11

Description

@am11

s_useThreadAllocationContexts is ever false for win-x86/x64 and single processor:

s_useThreadAllocationContexts = !useGlobalAllocationContext && (IsServerHeap() || ::g_SystemInfo.dwNumberOfProcessors != 1 || CPUGroupInfo::CanEnableGCCPUGroups());

In some places they have specialized optimizations, e.g. this win-x64 only branch:

else
{
// Replace the 1p slow allocation helpers with faster version
//
// When we're running Workstation GC on a single proc box we don't have
// InlineGetThread versions because there is no need to call GetThread
SetJitHelperFunction(CORINFO_HELP_NEWSFAST, JIT_TrialAllocSFastSP);
SetJitHelperFunction(CORINFO_HELP_NEWSFAST_ALIGN8, JIT_TrialAllocSFastSP);
SetJitHelperFunction(CORINFO_HELP_BOX, JIT_BoxFastUP);
SetJitHelperFunction(CORINFO_HELP_NEWARR_1_VC, JIT_NewArr1VC_UP);
SetJitHelperFunction(CORINFO_HELP_NEWARR_1_OBJ, JIT_NewArr1OBJ_UP);
ECall::DynamicallyAssignFCallImpl(GetEEFuncEntryPoint(AllocateStringFastUP), ECall::FastAllocateString);
}

Are these relevant? If not, we can delete these paths.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-GC-coreclrquestionAnswer questions and provide assistance, not an issue with source code or documentation.untriagedNew issue has not been triaged by the area owner

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions