This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: valgrind reports "definitely lost" memory for very simple codes
- From: Damian Rouson <damian at sourceryinstitute dot org>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>, Fortran List <fortran at gcc dot gnu dot org>, Clune Tom <Thomas dot L dot Clune at nasa dot gov>, Weiyuan Jiang <weiyuan dot jiang at nasa dot gov>
- Date: Thu, 7 May 2015 23:10:15 -0700
- Subject: Re: valgrind reports "definitely lost" memory for very simple codes
- Authentication-results: sourceware.org; auth=none
- References: <3EAB6301-2309-4012-922F-777AD6722669 at sourceryinstitute dot org> <20150508050426 dot GA69372 at troutmask dot apl dot washington dot edu> <554C504F dot 5050601 at net-b dot de>
> On May 7, 2015, at 10:57 PM, Tobias Burnus <burnus@net-b.de> wrote:
>
> If you want the compiler to automatically deallocate those variables, put your main program into a BLOCK, e.g.:
>
> program main
> BLOCK
> real, allocatable :: x
> x=0.
> END BLOCK
> end program main
>
Thanks for reminding me of this, Tobias. It fixes all the cases I reported. I believe I’ll have some more complicated cases to report that actually are memory leaks within a day or two.
Damian