This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Memory leaks in standard code
- From: Tobias Schlüter <Tobias dot Schlueter at physik dot uni-muenchen dot de>
- To: FX <fxcoudert at gmail dot com>
- Cc: "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>
- Date: Fri, 15 Feb 2008 14:15:44 +0100
- Subject: Re: Memory leaks in standard code
- References: <19c433eb0802150512g167b4f02q6b29f7879f7c0fd5@mail.gmail.com>
FX wrote:
I realize, though, that
having memory leaks is rather hard in Fortran, because of the
automatic deallocation on procedure exit... so I'm asking a very naive
question: is it possible at all?
REAL, ALLOCATABLE :: A(:)
DO WHILE(!condition)
! Do something
ALLOCATE(A(50))
END DO
END
generates a memory leak, unless ALLOCATE guards against this.
Cheers,
- Tobi
--
Tobias Schlüter
Am Coulombwall 1, Zi. 326
85748 Garching b. München
Tel.: +49/89/289-14139