On 5/17/15 7:13 AM, Peter Alexander wrote:
On Friday, 15 May 2015 at 16:36:29 UTC, Andrei Alexandrescu wrote:
This is a matter with some history behind it. In C, malloc(0) always
returns a new, legit pointer that can be subsequently reallocated,
freed etc.

Is the invariant malloc(0) != malloc(0) the only thing that makes 0 a
special case here?

I thought so, but apparently C99 _does_ allow malloc(0) to return null, so that's not an invariant :o).

Well for now std.allocator will go with null.


Andrei

Reply via email to