std.allocator.allocate(0) -> return null or std.allocator.allocate(1)?

Peter Alexander via Digitalmars-d digitalmars-d at puremagic.com
Sun May 17 07:13:02 PDT 2015


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?


More information about the Digitalmars-d mailing list