Skip to content

Commit

Permalink
Fix one source of perf regression in GCHeap::Alloc. This impacts the …
Browse files Browse the repository at this point in the history
…System.Collections.CtorFromCollectionNonGeneric<Int32> family of benchmarks. (#64091)

These benchmarks manage to make GCHeap::Alloc into a hotspot, so the call to IsHeapPointer() at the end matters for performance.
  • Loading branch information
PeterSolMS authored Jan 24, 2022
1 parent f4bfd05 commit bb5ca4c
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/coreclr/gc/gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44081,12 +44081,8 @@ GCHeap::Alloc(gc_alloc_context* context, size_t size, uint32_t flags REQD_ALIGN_
}

CHECK_ALLOC_AND_POSSIBLY_REGISTER_FOR_FINALIZATION(newAlloc, size, flags & GC_ALLOC_FINALIZE);

#ifdef USE_REGIONS
if (!IsHeapPointer (newAlloc))
{
GCToOSInterface::DebugBreak();
}
assert (IsHeapPointer (newAlloc));
#endif //USE_REGIONS

return newAlloc;
Expand Down

0 comments on commit bb5ca4c

Please sign in to comment.