Repository navigation
Clean up CoreCLR collection usage - #136595
Merged
AaronRobinsonMSFT merged 1 commit intoOct 28, 2026
Merged
Conversation
Use ArrayList iterators for the AppDomain assembly-list scans and remove the unused no-reference accessor. Handle the BITWISE_COPY spare-capacity case explicitly in SArray::Append while retaining growth and non-bitwise insertion behavior. Co-authored-by: Copilot <[email protected]> Copilot-Session: b690ada5-81db-4dea-85dc-8e95ea37917a
|
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: @agocke |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The review identifies no active issues requiring changes.
No open issues 🎉
What changed in this PR
This PR simplifies CoreCLR collection usage while retaining assembly-list locking and existing array growth behavior.
Changes:
- Use
ArrayList::Iteratorto find and update assembly-list entries. - Remove the unused indexed accessor and clarify iterator locking requirements.
- Add a
SArray::Appendpath for bitwise-copy elements when capacity is available, usingSetCountand returning a fresh iterator.
| File | Description |
|---|---|
src/coreclr/vm/appdomain.hpp |
Removes the unused accessor and documents iterator locking requirements. |
src/coreclr/vm/appdomain.cpp |
Converts assembly addition and removal loops to iterator-based traversal. |
src/coreclr/inc/sarray.h |
Handles bitwise-copy appends directly when spare capacity exists. |
Review effort: Balanced
jkoritzinsky
approved these changes
Oct 28, 2026
elinor-fung
approved these changes
Oct 28, 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.
Summary
ArrayList::IteratorinAppDomain::AddAssemblyandAppDomain::RemoveAssembly, retaining the existing assembly-list locking.AssemblyList::Get_UnlockedNoReferencemethod and clarify the iterator accessor's locking requirement.SArray::Appendexplicitly whenBITWISE_COPYis enabled and existing capacity can hold the new element. UseSetCountand return a fresh iterator; retain the existing growth and non-bitwise insertion paths.Note
This PR description was generated with GitHub Copilot.