On 29/12/09 -  15:31, Luca Braglia wrote:
> might it be
> 
>   if (pointer && size == 0)

or 
  if (pointer && !size){...} 


>     {
>       pointer = NULL;
>     }
> 
> so that pdf_alloc handles this exception (if one ask for 0 heap
> bytes) unlike classic malloc (that returns a pointer)?

at least on my Debian...

a rationale could be to uniform return value from malloc(0)
across platforms

(from current draft standard - 7.20.3):

If the size of the space requested is zero, the behavior is
implementation- defined: either a null pointer is returned, or
the behavior is as if the size were some nonzero value, except
that the returned pointer shall not be used to access an object.

if i missed something, please let me know

bye


Reply via email to