[FFmpeg-cvslog] Make av_realloc(0) behave like our av_malloc(0)

Nicolas George nicolas.george at normalesup.org
Sun May 8 11:04:25 CEST 2011


L'octidi 18 floréal, an CCXIX, Daniel Verkamp a écrit :
> > "If size is 0, either a null pointer or a unique pointer that can be
> > successfully passed to free() is returned."
> 
> That's not actually the part I meant; see Description:
> 
>    "If size is 0 and ptr is not a null pointer, the object pointed to is
>    freed."
> 
> I think the Return Value section is referring to the case where ptr ==
> NULL && size == 0, whereas I meant the case where ptr != NULL && size
> == 0, but it's not very clear.

I has already notices that the spec is not completely consistent. Jesuits
can explain that there is no contradiction: "the object pointed to is freed"
does not exclude that another, 0-sized, object is allocated.

And for a more practical information: it seems that this behaviour is the
usual / default for most BSD-based Unix.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-cvslog/attachments/20110508/5e400f1d/attachment.asc>


More information about the ffmpeg-cvslog mailing list