Skip to content

Replace SHash of call counting managers with linked list.#126729

Open
rcj1 wants to merge 1 commit intodotnet:mainfrom
rcj1:remove-callcountingmanager-shasah
Open

Replace SHash of call counting managers with linked list.#126729
rcj1 wants to merge 1 commit intodotnet:mainfrom
rcj1:remove-callcountingmanager-shasah

Conversation

@rcj1
Copy link
Copy Markdown
Contributor

@rcj1 rcj1 commented Apr 9, 2026

We only add, remove, and iterate through all here - we never make use of the hashing behavior. So, it is more appropriate to have this as a linked list as opposed to an SHash.

@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke
See info in area-owners.md if you want to be subscribed.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR simplifies call counting manager tracking in CoreCLR by replacing an SHash that was only used for add/remove/iterate with a lightweight linked-list, and adjusts startup initialization accordingly.

Changes:

  • Replace the global SHash of CallCountingManager instances with an intrusive linked list (O(1) add/remove, simple iteration).
  • Remove CallCountingManager::StaticInitialize() and call CallCountingStub::StaticInitialize() directly during EE startup.
  • Update all iterations over managers to traverse the linked list.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/coreclr/vm/ceemain.cpp Switch tiered compilation startup init from CallCountingManager::StaticInitialize() to CallCountingStub::StaticInitialize().
src/coreclr/vm/callcounting.h Remove manager SHash traits/storage; add linked-list fields and update static storage type.
src/coreclr/vm/callcounting.cpp Implement linked-list insertion/removal and update all manager iteration sites; delete unused hash-traits and static init.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants