Should GC.malloc be considered 'pure'?

Kagamin spam at here.lot
Thu Jun 9 22:10:00 PDT 2011


bearophile Wrote:

> Did you miss the discussion I've had here about the @trasparent? The allocation of heap memory can be considered pure if you use the allocated memory as a referentially transparent value (this means it's allowed to be used by reference, but your code is not allowed to read the value of the reference itself, so the future state of the code depends only on the contents of the referenced memory, and not the reference itself.

Won't this pollute everything with @trasparent annotations, because code usually doesn't depend on pointer value so it would want to work on transparent pointers.


More information about the Digitalmars-d mailing list