Changes :
Standard_MMgrOpt::Reallocate has been modified to allocate new memory block if NULL pointer has been passed.
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;
//! Allocate aSize bytes; see class description above
Standard_EXPORT virtual Standard_Address Allocate(const Standard_Size aSize);
- //! Reallocate previously allocated aPtr to a new size; aPtr is nullified
+ //! Reallocate previously allocated aPtr to a new size; aPtr is nullified.
+ //! In case that aPtr is null, the function behaves exactly as Allocate.
Standard_EXPORT virtual Standard_Address Reallocate(Standard_Address& aPtr,
const Standard_Size aSize);