GC.malloc is pure - wat

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Fri Apr 24 12:41:21 PDT 2015


On 4/24/15 3:12 PM, deadalnix wrote:
> On Friday, 24 April 2015 at 18:48:43 UTC, Steven Schveighoffer wrote:
>> I think you are thinking of @safe-ty. malloc and free can be pure, but
>> must be contained properly.
>>
>> purity when it comes to mutable data is a tricky thing.
>
> No, it should not be pure because it alter global state in a manner
> visible to the program.

But so does GC.malloc.

In any case, it's already been stated by Walter/Andrei that they are not 
interested in making C malloc/free pure. So it's a moot issue to argue over.

This likely will come up again when std.allocator is completed, and we 
can re-examine it then.

-Steve


More information about the Digitalmars-d mailing list