Skip to content

Commit

Permalink
Minimize locking duration for decommitLock (#103996)
Browse files Browse the repository at this point in the history
  • Loading branch information
cshung authored Jun 27, 2024
1 parent 2b4a4bc commit f920dac
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/coreclr/gc/gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52871,11 +52871,6 @@ int gc_heap::refresh_memory_limit()

GCToEEInterface::SuspendEE(SUSPEND_FOR_GC);


#ifdef COMMITTED_BYTES_SHADOW
decommit_lock.Enter();
#endif //COMMITTED_BYTES_SHADOW

uint32_t nhp_from_config = static_cast<uint32_t>(GCConfig::GetHeapCount());
#ifdef MULTIPLE_HEAPS
uint32_t nhp = n_heaps;
Expand Down Expand Up @@ -52928,14 +52923,13 @@ int gc_heap::refresh_memory_limit()
#ifdef COMMITTED_BYTES_SHADOW
else
{
decommit_lock.Enter();
verify_committed_bytes ();
decommit_lock.Leave();
}
#endif //COMMITTED_BYTES_SHADOW

GCToEEInterface::RestartEE(TRUE);
#ifdef COMMITTED_BYTES_SHADOW
decommit_lock.Leave();
#endif

return (int)status;
}
Expand Down

0 comments on commit f920dac

Please sign in to comment.