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