54 references to HashHelpers
System.Private.CoreLib (54)
src\runtime\src\coreclr\nativeaot\Common\src\System\Collections\Concurrent\ConcurrentUnifier.cs (1)
206
int newSize =
HashHelpers
.GetPrime(_buckets.Length * 2);
src\runtime\src\coreclr\nativeaot\Common\src\System\Collections\Concurrent\ConcurrentUnifierW.cs (1)
284
newSize =
HashHelpers
.GetPrime(_buckets.Length * 2);
src\runtime\src\coreclr\nativeaot\Common\src\System\Collections\Concurrent\ConcurrentUnifierWKeyed.cs (1)
266
newSize =
HashHelpers
.GetPrime(_buckets.Length * 2);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\ConcurrentDictionary.cs (8)
183
capacity =
HashHelpers
.GetPrime(capacity);
725
var newTables = new Tables(new VolatileNode[
HashHelpers
.GetPrime(_initialCapacity)], tables._locks, new int[tables._countPerLock.Length], tables._comparer);
1023
collisionCount >
HashHelpers
.HashCollisionThreshold &&
1986
(newLength =
HashHelpers
.GetPrime(newLength)) > Array.MaxLength)
2229
return buckets[
HashHelpers
.FastMod((uint)hashcode, (uint)buckets.Length, tables._fastModBucketsMultiplier)]._node;
2246
bucketNo =
HashHelpers
.FastMod((uint)hashcode, (uint)buckets.Length, tables._fastModBucketsMultiplier);
2281
_fastModBucketsMultiplier =
HashHelpers
.GetFastModMultiplier((uint)buckets.Length);
2489
collisionCount >
HashHelpers
.HashCollisionThreshold &&
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Dictionary.cs (16)
190
HashHelpers
.SerializationInfoTable.Add(this, info);
491
int size =
HashHelpers
.GetPrime(capacity);
498
_fastModMultiplier =
HashHelpers
.GetFastModMultiplier((uint)size);
629
if (!typeof(TKey).IsValueType && collisionCount >
HashHelpers
.HashCollisionThreshold && comparer is NonRandomizedStringEqualityComparer)
1039
if (!typeof(TKey).IsValueType && collisionCount >
HashHelpers
.HashCollisionThreshold && comparer is NonRandomizedStringEqualityComparer)
1176
if (!typeof(TKey).IsValueType && collisionCount >
HashHelpers
.HashCollisionThreshold && comparer is NonRandomizedStringEqualityComparer)
1202
HashHelpers
.SerializationInfoTable.TryGetValue(this, out SerializationInfo? siInfo);
1243
HashHelpers
.SerializationInfoTable.Remove(this);
1246
private void Resize() => Resize(
HashHelpers
.ExpandPrime(_count), false);
1253
Debug.Assert(
HashHelpers
.IsPrime(newSize));
1278
_fastModMultiplier =
HashHelpers
.GetFastModMultiplier((uint)newSize);
1666
int newSize =
HashHelpers
.GetPrime(capacity);
1700
int newSize =
HashHelpers
.GetPrimeAtLeast(capacity);
1709
Debug.Assert(
HashHelpers
.IsPrime(newSize));
1718
_fastModMultiplier =
HashHelpers
.GetFastModMultiplier((uint)newSize);
1865
return ref buckets[
HashHelpers
.FastMod(hashCode, (uint)buckets.Length, _fastModMultiplier)];
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\HashSet.cs (17)
142
HashHelpers
.SerializationInfoTable.Add(this, info);
159
int threshold =
HashHelpers
.ExpandPrime(source.Count + 1);
277
return ref buckets[
HashHelpers
.FastMod((uint)hashCode, (uint)buckets.Length, _fastModMultiplier)];
519
if (!typeof(T).IsValueType && collisionCount >
HashHelpers
.HashCollisionThreshold && comparer is NonRandomizedStringEqualityComparer)
713
HashHelpers
.SerializationInfoTable.TryGetValue(this, out SerializationInfo? siInfo);
732
_fastModMultiplier =
HashHelpers
.GetFastModMultiplier((uint)capacity);
753
HashHelpers
.SerializationInfoTable.Remove(this);
1278
int newSize =
HashHelpers
.GetPrime(capacity);
1283
private void Resize() => Resize(
HashHelpers
.ExpandPrime(_count), forceNewHashCodes: false);
1290
Debug.Assert(
HashHelpers
.IsPrime(newSize));
1316
_fastModMultiplier =
HashHelpers
.GetFastModMultiplier((uint)newSize);
1372
int newSize =
HashHelpers
.GetPrimeAtLeast(capacity);
1381
Debug.Assert(
HashHelpers
.IsPrime(newSize));
1392
_fastModMultiplier =
HashHelpers
.GetFastModMultiplier((uint)newSize);
1411
int size =
HashHelpers
.GetPrime(capacity);
1420
_fastModMultiplier =
HashHelpers
.GetFastModMultiplier((uint)size);
1530
if (!typeof(T).IsValueType && collisionCount >
HashHelpers
.HashCollisionThreshold && comparer is NonRandomizedStringEqualityComparer)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Hashtable.cs (7)
275
int hashsize = (rawsize > InitialSize) ?
HashHelpers
.GetPrime((int)rawsize) : InitialSize;
374
HashHelpers
.SerializationInfoTable.Add(this, info);
408
incr = (uint)(1 + ((seed *
HashHelpers
.HashPrime) % ((uint)hashsize - 1)));
694
int rawsize =
HashHelpers
.ExpandPrime(_buckets.Length);
943
uint incr = unchecked((uint)(1 + ((seed *
HashHelpers
.HashPrime) % ((uint)newBuckets.Length - 1))));
1093
HashHelpers
.SerializationInfoTable.TryGetValue(this, out SerializationInfo? siInfo);
1175
HashHelpers
.SerializationInfoTable.Remove(this);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\ProbabilisticMapState.cs (3)
133
int modulus =
HashHelpers
.GetPrime(values.Length);
150
modulus =
HashHelpers
.GetPrime(values.Length);
162
modulus =
HashHelpers
.GetPrime(modulus + 1);