Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/coreclr/inc/clrconfigvalues.h
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ RETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableRiscV64Zbb, W("EnableRiscV64
#endif

// Runtime-async
RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_RuntimeAsync, W("RuntimeAsync"), 0, "Enables runtime async method support")
RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_RuntimeAsync, W("RuntimeAsync"), 1, "Enables runtime async method support")

///
/// Uncategorized
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/utilcode/allocmemtracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ AllocMemTracker::~AllocMemTracker()
AllocMemTrackerBlock* pDebugBlock = m_pFirstBlock;
for (int i = 0; pDebugBlock != &m_FirstBlock; i++)
{
CONSISTENCY_CHECK_MSGF(i < 10000, ("Linked list is much longer than expected, memory corruption likely\n"));
CONSISTENCY_CHECK_MSGF(i < 60000, ("Linked list is much longer than expected, memory corruption likely\n"));
CONSISTENCY_CHECK_MSGF(pDebugBlock != nullptr, ("Linked list pointer == NULL, memory corruption likely\n"));
pDebugBlock = pDebugBlock->m_pNext;
}
Expand Down
18 changes: 13 additions & 5 deletions src/coreclr/vm/methodtablebuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2677,14 +2677,17 @@ MethodTableBuilder::EnumerateClassMethods()
if ((DWORD)MAX_SLOT_INDEX <= cMethAndGaps)
BuildMethodTableThrowException(IDS_CLASSLOAD_TOO_MANY_METHODS);

bmtMethod->m_cMaxDeclaredMethods = (SLOT_INDEX)cMethAndGaps;

if (g_pConfig->RuntimeAsync())
// In a worst case the number of declared methods can double
// as each async method may have two variants.
// The method count is typically a modest number though.
// We will reserve twice the size for the builder, up to the max, just in case.
DWORD cMethUpperBound = cMethAndGaps * 2;
if (cMethUpperBound >= (DWORD)MAX_SLOT_INDEX)
{
// TODO: (async) the index is uint16 and can potentially overflow. This needs to be more robust.
bmtMethod->m_cMaxDeclaredMethods *= 2;
cMethUpperBound = MAX_SLOT_INDEX - 1;
}

bmtMethod->m_cMaxDeclaredMethods = (SLOT_INDEX)cMethUpperBound;
bmtMethod->m_cDeclaredMethods = 0;
bmtMethod->m_rgDeclaredMethods = new (GetStackingAllocator())
bmtMDMethod *[bmtMethod->m_cMaxDeclaredMethods];
Expand Down Expand Up @@ -3305,6 +3308,11 @@ MethodTableBuilder::EnumerateClassMethods()
bmtMDMethod *pDeclaredMethod = NULL;
for (int insertCount = 0; insertCount < 2; insertCount++)
{
if (bmtMethod->m_cDeclaredMethods >= bmtMethod->m_cMaxDeclaredMethods)
{
BuildMethodTableThrowException(IDS_CLASSLOAD_TOO_MANY_METHODS);
}

bmtMDMethod * pNewMethod;
if (insertCount == 0)
{
Expand Down
5 changes: 0 additions & 5 deletions src/tests/async/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,5 @@
<DisableProjectBuild Condition="'$(TestBuildMode)' == 'nativeaot' and '$(TargetArchitecture)' == 'arm64'">true</DisableProjectBuild>
</PropertyGroup>

<PropertyGroup>
<!-- runtime async testing in main repo NYI -->
<DisableProjectBuild Condition="'$(TestBuildMode)' != 'nativeaot'">true</DisableProjectBuild>
</PropertyGroup>

<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets, $(MSBuildThisFileDirectory)..))" />
</Project>
Loading
Loading