This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix pretty-printer leak
- From: Richard Biener <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 25 Nov 2013 15:40:42 +0100 (CET)
- Subject: [PATCH] Fix pretty-printer leak
- Authentication-results: sourceware.org; auth=none
This reduces peak memory usage for -fdump-tree-all on tree.c with -O2
from several GB to a 200MB.
It helps really freeing obstacks ;)
Testing in progress.
Richard.
2013-11-25 Richard Biener <rguenther@suse.de>
* pretty-print.c (output_buffer::~output_buffer): Really
free the obstacks.
Index: gcc/pretty-print.c
===================================================================
*** gcc/pretty-print.c (revision 205352)
--- gcc/pretty-print.c (working copy)
*************** output_buffer::output_buffer ()
*** 50,57 ****
output_buffer::~output_buffer ()
{
! obstack_free (&chunk_obstack, obstack_finish (&chunk_obstack));
! obstack_free (&formatted_obstack, obstack_finish (&formatted_obstack));
}
/* A pointer to the formatted diagnostic message. */
--- 50,57 ----
output_buffer::~output_buffer ()
{
! obstack_free (&chunk_obstack, NULL);
! obstack_free (&formatted_obstack, NULL);
}
/* A pointer to the formatted diagnostic message. */