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