1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-26 19:48:01 +02:00

Large collection fixes

This commit is contained in:
Brian Fiete 2023-08-18 12:04:01 -07:00
parent e8880cd59c
commit d0de4776f3
5 changed files with 25 additions and 10 deletions

View file

@ -364,6 +364,7 @@ namespace System.Collections
#unwarn
if (sizeof(int_cosize) == 8)
return (int_cosize)(hashCode & 0x7FFFFFFF'FFFFFFFFL);
#unwarn
return ((int32)hashCode ^ (int32)((int64)hashCode >> 33)) & 0x7FFFFFFF;
}
@ -629,7 +630,7 @@ namespace System.Collections
return oldPtr;
}
private bool RemoveEntry(int32 hashCode, int_cosize index)
private bool RemoveEntry(int_cosize hashCode, int_cosize index)
{
if (mBuckets != null)
{

View file

@ -1220,7 +1220,7 @@ namespace System.Collections
public struct Enumerator : IEnumerator<T>
{
private HashSet<T> mSet;
private int32 mIndex;
private int_cosize mIndex;
#if VERSION_HASHSET
private int32 mVersion;
#endif

View file

@ -252,7 +252,7 @@ namespace System.Collections
get
{
return ref mItems[index.Get(mSize)];
}
}
[Checked]
set
@ -330,6 +330,7 @@ namespace System.Collections
T* Realloc(int newSize, bool autoFree)
{
Runtime.Assert(newSize <= int_cosize.MaxValue);
T* oldAlloc = null;
if (newSize > 0)
{