summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFadi Hanna <fadim@microsoft.com>2019-10-02 11:52:09 -0700
committerAlexander Soldatov/AI Compiler Lab /SRR/Staff Engineer/삼성전자 <soldatov.a@samsung.com>2019-10-07 12:00:00 +0300
commitc0f48cf274383cf31b91dfabdbe46a2d949a75ea (patch)
tree0fba955fc2f5af40150f4eb15c827c1ba4eb60cf
parent3296ac40de1a0be7e24f1c5c1511fb5cd615bbde (diff)
downloadcoreclr-c0f48cf274383cf31b91dfabdbe46a2d949a75ea.tar.gz
coreclr-c0f48cf274383cf31b91dfabdbe46a2d949a75ea.tar.bz2
coreclr-c0f48cf274383cf31b91dfabdbe46a2d949a75ea.zip
Use VolaiteLoad to read counter
-rw-r--r--src/vm/ngenhash.inl4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vm/ngenhash.inl b/src/vm/ngenhash.inl
index 43d03f9753..5df567fd5b 100644
--- a/src/vm/ngenhash.inl
+++ b/src/vm/ngenhash.inl
@@ -151,7 +151,7 @@ void NgenHashTable<NGEN_HASH_ARGS>::BaseInsertEntry(NgenHashValue iHash, VALUE *
pVolatileEntry->m_iHashValue = iHash;
// Compute which bucket the entry belongs in based on the hash.
- DWORD dwBucket = iHash % m_cWarmBuckets;
+ DWORD dwBucket = iHash % VolatileLoad(&m_cWarmBuckets);
// Prepare to link the new entry at the head of the bucket chain.
pVolatileEntry->m_pNextEntry = (GetWarmBuckets())[dwBucket];
@@ -1264,7 +1264,7 @@ DPTR(VALUE) NgenHashTable<NGEN_HASH_ARGS>::FindVolatileEntryByHash(NgenHashValue
_ASSERTE(m_cWarmBuckets > 0);
// Compute which bucket the entry belongs in based on the hash.
- DWORD dwBucket = iHash % m_cWarmBuckets;
+ DWORD dwBucket = iHash % VolatileLoad(&m_cWarmBuckets);
// Point at the first entry in the bucket chain which would contain any entries with the given hash code.
PTR_VolatileEntry pEntry = (GetWarmBuckets())[dwBucket];