How to express the fact that arguments don't escape?
N.M. Maclaren
nmm1@cam.ac.uk
Mon Aug 17 12:52:00 GMT 2009
On Aug 17 2009, Michael Matz wrote:
>
>non-escaping: the given pointer is not stored into global memory. This
> ensures that when the function returns nothing else remembers
> this pointer in an untrackable (aka magic :) ) way.
Er, not entirely. That's only part of it. The actual condition needed is
that the target is never assigned to a pointer with a wider scope than
that of the target. If I have got it right, the effective scope of ordinary
dummy arguments is that of their declaration, and so they cannot be assigned
to other dummy (pointer) arguments, directly or indirectly.
In the last, I am referring to tricks like passing them to another
procedure, which declares them with the TARGET attribute. Fortran has
closed that one, and any associated pointers become undefined on return
from the procedure with the TARGET attribute. Fortran has NOT currently
closed that one for the ASYNCHRONOUS and VOLATILE attributes.
Regards,
Nick.
More information about the Fortran
mailing list