Replace SHash of call counting managers with linked list.#126729
Replace SHash of call counting managers with linked list.#126729rcj1 wants to merge 1 commit intodotnet:mainfrom
Conversation
|
Tagging subscribers to this area: @agocke |
There was a problem hiding this comment.
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
SHashofCallCountingManagerinstances with an intrusive linked list (O(1) add/remove, simple iteration). - Remove
CallCountingManager::StaticInitialize()and callCallCountingStub::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. |
| MethodDescForwarderStubHash m_methodDescForwarderStubHash; | ||
| SArray<CallCountingInfo *> m_callCountingInfosPendingCompletion; | ||
|
|
||
| CallCountingManager **m_pPreviousManager = nullptr; |
There was a problem hiding this comment.
This is a bit unusual way to implement double-linked list. CallCountingManager *m_previousManager = nullptr; would a more canonical way to implement double-linked list.
There was a problem hiding this comment.
I see we already have SList, would you prefer we use that instead?
There was a problem hiding this comment.
I do not have a strong preference. It is probably going to be fewer lines if you switch to SList.
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.