On 03/25/2011 09:31 AM, Eric Blake wrote: > xrealloc(NULL,0) _must_ return malloc(0) rather than blindly returning NULL.
Yes, that makes sense too. Thanks for thinking it through. The change you just installed causes xrealloc (NULL, 0) to return realloc (NULL, 0) without failing, which boils down to the same thing (and is arguably better, on weird implementations where malloc (0) and realloc (NULL, 0) have different semantics). Who would have thought back in the early 1970s when these primitives were designed that we'd still be arguing about their semantics four decades latter?
