[Patch, fortran] Runtime memory leak checking.

Mikael Morin mikael.morin@tele2.fr
Sun Nov 30 15:35:00 GMT 2008


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



More information about the Gcc-patches mailing list