On Sun, 6 Dec 2009, Paolo Bonzini wrote: > On 12/06/2009 11:22 AM, malc wrote: > > Here, i believe, you are inventing artificial restrictions on how > > malloc behaves, i don't see anything that prevents the implementor > > from setting aside a range of addresses with 31st bit set as an > > indicator of "zero" allocations, and then happily giving it to the > > user of malloc and consumming it in free. > > But it has to make it a valid address anyway. If a zero-sized read treats it > as invalid (SIGSEGV, EFAULT, whatever), malloc has failed to return a valid > address and is not obeying its specification.
Once again - standard doesn't speak about "valid addresses". -- mailto:av1...@comtv.ru