This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, fortran] Runtime memory leak checking.
- From: Mikael Morin <mikael dot morin at tele2 dot fr>
- To: Paul Richard Thomas <paul dot richard dot thomas at gmail dot com>
- Cc: "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 30 Nov 2008 16:14:33 +0100
- Subject: Re: [Patch, fortran] Runtime memory leak checking.
- References: <339c37f20811290935le65cc42q871adff5cde4874a@mail.gmail.com>
Paul Richard Thomas wrote:
>
> OK to go on ice ready for 4.5? (Is there any appetite to add it to 4.4?)
>
> Paul
Hi Paul,
my comments:
Here, we should probably change the first line too
2. Make sure each time `-lgfortran' or `-lm' is seen, it forms
- part of the series `-lgfortran -lm'.
+ part of the series `-lgfortran -liberty -lm'.
some indenting problems (find where it is :-)):
+ if (gfc_option.rtcheck & GFC_RTCHECK_MEMLEAKS)
+ gfc_add_modify (&alloc_block, res,
/* Free the temporary afterwards. */
- tmp = gfc_call_free (var);
+ tmp = gfc_call_free (var, true, &gfc_current_locus,
+ ALLOCTYPE_TEMPORARY);
gfc_add_expr_to_block (&se->post, tmp);
space indenting:
+ /* Succesfully found in the allocation table. */
+ if (type == ALLOCTYPE_TEMPORARY)
+ usedmem_temp -= (*slot)->size;
+ else
+ usedmem_user -= (*slot)->size;
+
+ htab_clear_slot (tab, (void *) slot);
Ok for 4.5.
Thank you (and FX).
Mikael