Migrate CordbModule caches to SHash - #132264
Draft
hoyosjs wants to merge 1 commit into
Draft
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: be313a78-7324-43ea-9fdb-df0e0bd028b8
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces an SHash-backed hashtable wrapper for right-side debugger (Cordb*) caches and migrates CordbModule’s class/function/native-code caches from the fixed-bucket CordbSafeHashTable to the new CordbSHashTable, keeping the existing internal-ref ownership and RS lock assertions.
Changes:
- Generalize
RSInitHolder::TransferOwnershipToHashto work with multiple hashtable types (not justCordbSafeHashTable). - Add
CordbSHashTable+CordbSHashTraits(pointer-elementSHashwrapper) with 64-bit key hashing that incorporates the high 32 bits. - Switch
CordbModule’sm_classes,m_functions, andm_nativeCodeTabletoCordbSHashTableand remove the old fixed bucket-count ctor initialization.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/coreclr/debug/di/rspriv.h | Adds CordbSHashTable wrapper/traits and updates CordbModule cache member types; makes TransferOwnershipToHash generic. |
| src/coreclr/debug/di/module.cpp | Adjusts CordbModule constructor initialization to match the new cache types (default-constructed tables) while preserving debug lock wiring and existing call patterns. |
This was referenced Aug 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #11466.
CordbSafeHashTableuses a fixed bucket count, causing lookups to degrade as debugger caches grow. This migrates the high-cardinality, non-enumeratedCordbModuleclass, function, and native-code caches to an SHash-backed table.The new table preserves internal reference ownership, process-lock assertions, lazy allocation, function-version replacement, and linear-time cleanup. It also hashes the full pointer width on 64-bit hosts.
COM-enumerated and EE/DAC tables remain unchanged because they depend on cursor, iteration, or storage-layout behavior that requires separate work.
There are no intended breaking changes.
Note
This pull request description was generated with GitHub Copilot.