1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-24 13:50:49 +03:00

0023033: Standard_MMgrOpt::Reallocate behavior must be similar to "realloc"

Changes :
Standard_MMgrOpt::Reallocate has been modified to allocate new memory block if NULL pointer has been passed.
This commit is contained in:
dbv
2012-03-21 15:16:30 +04:00
parent 2f43ec3255
commit cf9a910a8a
2 changed files with 8 additions and 1 deletions

View File

@@ -718,6 +718,12 @@ void Standard_MMgrOpt::FreePools()
Standard_Address Standard_MMgrOpt::Reallocate(Standard_Address& theStorage,
const Standard_Size theNewSize)
{
// if theStorage == NULL, just allocate new memory block
if (!theStorage)
{
return Allocate(theNewSize);
}
Standard_Size * aBlock = GET_BLOCK(theStorage);
Standard_Address newStorage = NULL;