John Macdonald writes:
> 
> But if no memory is actually allocated, how do you ensure that the
> address of the zero-length chunk is different?  Since it didn't use
> any memory, the same memory address is still free and is likely to be
> returned as the result of the next allocation request too.

The ANSI/ISO C standards do not allow that behavior.  If malloc(0) does
not return a null pointer, it is required to return a unique address
like it does for non-zero requests.

-Larry Jones

Please tell me I'm adopted. -- Calvin

Reply via email to