1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-15 06:44:10 +02:00

Fixed large allocation issues

This commit is contained in:
Brian Fiete 2019-12-05 06:51:11 -08:00
parent 9ad57895e2
commit c531ade968
5 changed files with 59 additions and 35 deletions

View file

@ -685,7 +685,7 @@ namespace System
void Realloc(int newSize)
{
Debug.Assert(AllocSize > 0, "String has been frozen");
Debug.Assert((uint_strsize)newSize < 0x40000000);
Debug.Assert((uint_strsize)newSize <= cSizeFlags);
char8* newPtr = new:this char8[newSize]*;
Internal.MemCpy(newPtr, Ptr, mLength);
if (IsDynAlloc)
@ -703,7 +703,7 @@ namespace System
void Realloc(char8* newPtr, int newSize)
{
Debug.Assert(AllocSize > 0, "String has been frozen");
Debug.Assert((uint_strsize)newSize < 0x40000000);
Debug.Assert((uint_strsize)newSize <= cSizeFlags);
Internal.MemCpy(newPtr, Ptr, mLength);
if (IsDynAlloc)
delete:this mPtr;