Re: Allocatable Components of Derived Type



tommcd <TCMcDermott@xxxxxxxxx> wrote:

Of the four compilers tested (all compiled with default options) Intel
Fortran was the only
one which required that the local variable of the derived type be
explicitly deallocated
(via the call to delete_stack(T_local)) otherwise the memory used
increased rapidly.

Is this requirement standard conforming behavior?

1. No.

2. You can generalize that to all uses of allocatable. Allocatables
don't cause memory leaks. Unless, of course, there is a compiler bug.

--
Richard Maine | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle | -- Mark Twain
.



Relevant Pages

  • PRIVATE statement in UDDT causes memory leak with ALLOCATABLE components?
    ... I now use the above derived type in another definition: ... I'm at a bit of a loss to figure out why commenting out the private statement causes the memory leaks to disappear. ... Is it because my simple understanding of the garbage handling of f95 tr15581 allocatables doesn't extend down into subcomponents? ...
    (comp.lang.fortran)
  • Re: Allocatable Components of Derived Type
    ... Fortran was the only ... one which required that the local variable of the derived type be ... Allocatables ... don't cause memory leaks. ...
    (comp.lang.fortran)
  • Re: Strong/weak pointers
    ... In Fortran, what you call strong pointers are ALLOCATABLE ... Barring a compiler or run-time bug, they cannot leak memory, ... The TR mentioned above removed a lot of required previous POINTER usage ... but that was because ALLOCATABLEs were ...
    (comp.compilers)
  • Re: Fortran 2003 and F
    ... > I have some questions for the creators of F, Brainerd and Hendrickson. ... > As the Fortran language keeps getting bigger, ... a problem with TR allocatables. ...
    (comp.lang.fortran)
  • Re: Speed penalty for using allocatable arrays?
    ... non-conforming. ... You can't EQUIVALENCE allocatables, ... that Fortran has. ... Arrays are always assumed shape (including ...
    (comp.lang.fortran)