This is the mail archive of the mailing list for the GNU Fortran project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, fortran] Runtime memory leak checking.

Paul Richard Thomas wrote:
> It also adds hooks for memusage and recursion in runtime.
The following does not work:
It is accepted but does not enable bounds checking.

I think you should also a flag for -fcheck-array-temporaries to
and maybe also "all". What is "memusage" supposed to do?

(I think you plan to add a patch for "memusage" soon; if not I'd prefer
that remove the option.)

@@ -5453,8 +5469,9 @@
 				    TYPE_SIZE_UNIT (gfc_get_element_type (type))));
   /* Allocate memory to the destination.  */
-  tmp = gfc_call_malloc (&block, TREE_TYPE (gfc_conv_descriptor_data_get (src)),
-			 size);
+  tmp = gfc_allocate_with_status (&block, size, NULL_TREE,
+				  &gfc_current_locus);
+  tmp = fold_convert (TREE_TYPE (gfc_conv_descriptor_data_get (src)), tmp);
   gfc_conv_descriptor_data_set (&block, dest, tmp);

Is there a reason that you don't use
  if (gfc_option.rtcheck & GFC_RTCHECK_MEMLEAKS)
here, but that you have such an if in lines
@@ -4179,7 +4186,12 @@

You need to update invoke.texi. Additionally, you need to add the new
functions to After doing so, one can actually get rid of
the -static.

Is it really necessary to link libiberty even if no memleak checks are


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]