1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-16 15:24:10 +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

@ -756,7 +756,7 @@ namespace System
void Realloc(int newSize)
{
Debug.Assert(AllocSize > 0, "String has been frozen");
Debug.Assert((uint)newSize <= cSizeFlags);
Runtime.Assert((uint)newSize <= cSizeFlags);
char8* newPtr = new:this char8[newSize]* (?);
Internal.MemCpy(newPtr, Ptr, mLength);
#if VALGRIND
@ -776,8 +776,9 @@ namespace System
void Realloc(char8* newPtr, int newSize)
{
Runtime.Assert(newSize <= int_cosize.MaxValue);
Debug.Assert(AllocSize > 0, "String has been frozen");
Debug.Assert((uint)newSize <= cSizeFlags);
Runtime.Assert((uint)newSize <= cSizeFlags);
Internal.MemCpy(newPtr, Ptr, mLength);
if (IsDynAlloc)
delete:this mPtrOrBuffer;