On Friday, 24 April 2015 at 17:07:20 UTC, deadalnix wrote:
On Friday, 24 April 2015 at 15:43:17 UTC, anonymous wrote:
[...]
Could core.stdc.stdlib.malloc and friends also be marked pure then?

No.

Allocating on the GC is "stateless" as the GC will handle the state by itself, from the program perspective, there is no state to maintain.

malloc require free, and the state management is pushed on the application rather than the runtime. It is not pure.

There's also GC.free, which is also marked pure.

I can't see how GC.malloc followed by GC.free is more pure than stdlib malloc followed by stdlib free.

Reply via email to