lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


>>>>> "Philippe" == Philippe Verdy <verdyp@gmail.com> writes:

 Philippe> Which standard? In C/C++ or Lua?

The C standard says that realloc() is allowed to fail (regardless of the
relative sizes of the old and new blocks), and moreover that if it does
fail, the original block is unchanged and is still valid.

The application always has the option of just using the original block
pointer after a realloc failed to shrink the block - but the realloc
failure is an indication to the application that no memory was actually
freed.

-- 
Andrew.