Merge pull request #1035 from bpay/memfixes

Memfixes
This commit is contained in:
Luis Anton Rebollo 2015-01-25 13:42:32 +01:00
commit 6492028bb2
26 changed files with 79 additions and 52 deletions

View file

@ -495,7 +495,7 @@ DefineConsoleFunction( dumpStringMemStats, void, (), , "()"
void* String::StringData::operator new( size_t size, U32 len )
{
AssertFatal( len != 0, "String::StringData::operator new() - string must not be empty" );
StringData *str = reinterpret_cast<StringData*>( dMalloc( size + len * sizeof(StringChar) ) );
StringData *str = static_cast<StringData*>( dMalloc( size + len * sizeof(StringChar) ) );
str->mLength = len;
@ -523,7 +523,7 @@ void String::StringData::operator delete(void *ptr)
void* String::StringData::operator new( size_t size, U32 len, DataChunker& chunker )
{
AssertFatal( len != 0, "String::StringData::operator new() - string must not be empty" );
StringData *str = reinterpret_cast<StringData*>( chunker.alloc( size + len * sizeof(StringChar) ) );
StringData *str = static_cast<StringData*>( chunker.alloc( size + len * sizeof(StringChar) ) );
str->mLength = len;