This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

Re: purify experiments


> 15 additional megabytes are "potentially leaked" (meaning that there is
> something that looks like a pointer into the middle of the object but not
> the beginning) from one source: memory allocated at line 1810 of
> find_exception_handler_labels:
> 
>         /* We call xmalloc here instead of alloca; we did the latter in the past,
>            but found that it can sometimes end up being asked to allocate space
>            for more than 1 million labels.  */
>    =>   labels = (rtx *) xmalloc ((max_labelno - min_labelno) * sizeof (rtx));
>         bzero ((char *) labels, (max_labelno - min_labelno) * sizeof (rtx));
>       
>         /* Arrange for labels to be indexed directly by CODE_LABEL_NUMBER.  */

My bad.  I've put this fix into EGCS & gcc2:

1997-09-30  Brendan Kehoe  <brendan@lisa.cygnus.com>

	* except.c (find_exception_handler_labels): Free LABELS when we're
	done.

Index: except.c
diff -u -p -r1.24 except.c
--- except.c	1997/09/18 23:31:01	1.24
+++ except.c	1997/09/30 17:38:17
@@ -1847,6 +1847,8 @@ find_exception_handler_labels ()
 	    warning ("mismatched EH region %d", NOTE_BLOCK_NUMBER (insn));
 	}
     }
+
+  free (labels);
 }
 
 /* Perform sanity checking on the exception_handler_labels list.

-- 
Brendan Kehoe                                               brendan@cygnus.com
Cygnus Solutions, Sunnyvale, CA                                +1 408 542 9600

Web page: http://www.zen.org/~brendan/


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