Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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/vm/dynamicmethod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ HostCodeHeap::~HostCodeHeap()
delete[] m_pHeapList->pHdrMap;

if (m_pBaseAddr)
ClrVirtualFree(m_pBaseAddr, 0, MEM_RELEASE);
ExecutableAllocator::Instance()->Release(m_pBaseAddr);
LOG((LF_BCL, LL_INFO10, "Level1 - CodeHeap destroyed {0x%p}\n", this));
}

Expand Down
8 changes: 6 additions & 2 deletions src/coreclr/vm/loaderallocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1414,7 +1414,7 @@ void LoaderAllocator::Terminate()
// This was the block reserved by BaseDomain::Init for the loaderheaps.
if (m_InitialReservedMemForLoaderHeaps)
{
ClrVirtualFree (m_InitialReservedMemForLoaderHeaps, 0, MEM_RELEASE);
ExecutableAllocator::Instance()->Release(m_InitialReservedMemForLoaderHeaps);
m_InitialReservedMemForLoaderHeaps=NULL;
}

Expand Down Expand Up @@ -1687,7 +1687,11 @@ void AssemblyLoaderAllocator::Init(AppDomain* pAppDomain)
LoaderAllocator::Init((BaseDomain *)pAppDomain);
if (IsCollectible())
{
m_pShuffleThunkCache = new ShuffleThunkCache(m_pStubHeap);
// TODO: the ShuffleThunkCache should really be using the m_pStubHeap, however the unloadability support
// doesn't track the stubs or the related delegate classes and so we get crashes when a stub is used after
// the AssemblyLoaderAllocator is gone (the stub memory is unmapped).
// https://github.com/dotnet/runtime/issues/55697 tracks this issue.
m_pShuffleThunkCache = new ShuffleThunkCache(SystemDomain::GetGlobalLoaderAllocator()->GetExecutableHeap());
}
}

Expand Down