purity question

Rene Zwanenburg via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue May 30 02:12:16 PDT 2017


On Monday, 29 May 2017 at 01:36:24 UTC, Jonathan M Davis wrote:
>> A simple example: anything that has a malloc/free pair.
>
> Yeah, if you do it right, you should be fine, but you have to 
> do it right, and it's very easy to miss some detail that makes 
> it wrong to insist to the compiler that what you're doing is 
> pure.

If malloc were marked as pure, wouldn't that mean it must return 
the same pointer every time you call it with the same size?


More information about the Digitalmars-d-learn mailing list