Pure functions in D
Jason House
jason.james.house at gmail.com
Sat Sep 27 04:32:33 PDT 2008
Walter Bright Wrote:
> Bruno Medeiros wrote:
>
> > Will memory allocation be considered pure?
>
> I don't know yet. If memory allocation failure is a non-recoverable
> exception, then pure functions can allocate memory.
Pure functions allocating memory is a nice feature to have. A lot of D code wants to allocate memory. It would certainly allow more return values from pure functions. I don't know what impacts that'd have on the memory model. I've had the impression that parallelizing pure functions could be lockless.
More information about the Digitalmars-d
mailing list