Hi,
We currently say that one can deallocate an array pointer if it points
to the "whole of an object that was created by allocation". What
exactly does this mean (do we have a definition of whole?)? For
example:
real, dimension(:), pointer :: a, b
integer :: lb, ub
read(*,*) lb, ub
allocate(a(lb:ub))
read(*,*) lb, ub
b=>a(lb:ub)
deallocate(b)
If the second input happens to be the same as the first, is this legal?
I find it hard to believe vendors would check upon all pointer
assignments whether it is the whole of an object, and if so, mark the
appropriate descriptors (since many vendors do have fields to indicate
if ALLOCATE was involved and details about the allocation).
Thanks,
Aleks
|