-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Completely lock-free ClassLoader::LookupTypeKey #61346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
1b003e3
embedded size
VSadov 5330325
next array
VSadov c5db8c4
read consistency while rehashing
VSadov c264f69
comments
VSadov e8e7d6e
remove CRST_UNSAFE_ANYMODE and COOP mode in the callers
VSadov b9b4813
typo
VSadov 749695a
fix 32bit builds
VSadov 5569c66
couple changes from review.
VSadov 7c3cd08
Walk the buckets in resize.
VSadov f8b1021
remove a `REVIEW:` comment.
VSadov 067cefb
Update src/coreclr/vm/dacenumerablehash.inl
VSadov 1516f6b
remove use of `auto`
VSadov efe6043
DAC stuff
VSadov f455581
Constructor and GrowTable are not called by DAC, no need for DPTR, ad…
VSadov e874b3c
SKIP_SPECIAL_SLOTS
VSadov c7eb7e7
More compact dac_cast in GetNext
VSadov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
read consistency while rehashing
- Loading branch information
commit c5db8c48c5c1721ecd598bc336bfc161dbc09249
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -41,10 +41,12 @@ DacEnumerableHashTable<DAC_ENUM_HASH_ARGS>::DacEnumerableHashTable(Module *pModu | |||||
| m_pModule = pModule; | ||||||
| m_pHeap = pHeap; | ||||||
|
|
||||||
| S_SIZE_T cbBuckets = S_SIZE_T(sizeof(VolatileEntry*)) * S_SIZE_T(cInitialBuckets); | ||||||
| // two extra slots - slot [0] contains length, | ||||||
| // slot [1] will contain the next version of the table if it resizes | ||||||
| S_SIZE_T cbBuckets = S_SIZE_T(sizeof(VolatileEntry*)) * S_SIZE_T(cInitialBuckets + 2); | ||||||
|
|
||||||
| m_cEntries = 0; | ||||||
| m_pBuckets = (PTR_VolatileEntry*)(void*)GetHeap()->AllocMem(cbBuckets + S_SIZE_T(2 * sizeof(PTR_VolatileEntry))); | ||||||
| m_pBuckets = (PTR_VolatileEntry*)(void*)GetHeap()->AllocMem(cbBuckets); | ||||||
| ((size_t*)m_pBuckets)[0] = cInitialBuckets; | ||||||
|
|
||||||
| // Note: Memory allocated on loader heap is zero filled | ||||||
|
|
@@ -171,17 +173,19 @@ void DacEnumerableHashTable<DAC_ENUM_HASH_ARGS>::GrowTable() | |||||
| DWORD cBuckets = (DWORD)((size_t*)curBuckets)[0]; | ||||||
|
|
||||||
| // Make the new bucket table larger by the scale factor requested by the subclass (but also prime). | ||||||
| DWORD cNewBuckets = NextLargestPrime(cBuckets * SCALE_FACTOR); | ||||||
| S_SIZE_T cbNewBuckets = S_SIZE_T(cNewBuckets) * S_SIZE_T(sizeof(PTR_VolatileEntry)); | ||||||
| DWORD cNewBuckets = NextLargestPrime(cBuckets * SCALE_FACTOR); | ||||||
| // two extra slots - slot [0] contains length, | ||||||
| // slot [1] will contain the next version of the table if it resizes | ||||||
| S_SIZE_T cbNewBuckets = S_SIZE_T(cNewBuckets + 2) * S_SIZE_T(sizeof(PTR_VolatileEntry)); | ||||||
|
||||||
| S_SIZE_T cbNewBuckets = S_SIZE_T(cNewBuckets + 2) * S_SIZE_T(sizeof(PTR_VolatileEntry)); | |
| S_SIZE_T cbNewBuckets = (S_SIZE_T(cNewBuckets) + S_SIZE_T(2)) * S_SIZE_T(sizeof(PTR_VolatileEntry)); |
hoyosjs marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
hoyosjs marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
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.
Uh oh!
There was an error while loading. Please reload this page.