Re: stack overflow with reshape and transpose

From: Richard Maine (nospam_at_see.signature)
Date: 07/03/04


Date: Sat, 03 Jul 2004 08:23:05 -0700

Janne Blomqvist <jblomqvi@roskaposti.invalid> writes:

> tholen@antispam.ham wrote:
>> Along comes Fortran 90 with allocatable arrays....
>
> And now, Fortran programmers can also enjoy the thrills of memory
> leaks. ;-)

Note that allocatabhle arrays *PREVENT* memory leaks caused by programmer
errors (well, by the Fortran programmer). It is not possible to cause
a memory leak with allocatables, not matter how hard you try.

Of course, compilers can and do have bugs. Those bugs can and do
occasionally cause memory leaks. But allocatables very substantially
lower your exposure to memory leaks.

Pointers now, that's a completely different story. :-(
One of the major reasons for using allocatables is that they keep you
from having to use pointers in many applications. You do, however,
need at least the allocatable TR before allocatables are useful
enough to do this.

-- 
Richard Maine
email: my last name at domain
domain: summertriangle dot net


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: return value as an allocatable array
    ... standard f95 do not have memory leaks. ... Compiler bugs. ... Program bugs. ... show up in allocatables... ...
    (comp.lang.fortran)
  • Re: return value as an allocatable array
    ... standard f95 do not have memory leaks. ... Program bugs. ... Not much more to say about compiler bugs. ... show up in allocatables... ...
    (comp.lang.fortran)