diff options
author | Martin Sebor <msebor@redhat.com> | 2017-03-03 16:35:00 +0000 |
---|---|---|
committer | Martin Sebor <msebor@gcc.gnu.org> | 2017-03-03 09:35:00 -0700 |
commit | da7c751ba7725d9fd71eeff9423ae0e0518baa19 (patch) | |
tree | 5ab26fcfe0c2379490c77c00e1f88aff0180a583 /gcc/context.c | |
parent | d9074b295905374434534278524d541c47545347 (diff) | |
download | gcc-da7c751ba7725d9fd71eeff9423ae0e0518baa19.zip gcc-da7c751ba7725d9fd71eeff9423ae0e0518baa19.tar.gz gcc-da7c751ba7725d9fd71eeff9423ae0e0518baa19.tar.bz2 |
PR tree-optimization/79699 - small memory leak in MPFR
gcc/ChangeLog:
* context.c (context::~context): Free MPFR caches to avoid
a memory leak on program exit.
From-SVN: r245878
Diffstat (limited to 'gcc/context.c')
-rw-r--r-- | gcc/context.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/context.c b/gcc/context.c index a7ded9c..bacad5a 100644 --- a/gcc/context.c +++ b/gcc/context.c @@ -23,6 +23,7 @@ along with GCC; see the file COPYING3. If not see #include "context.h" #include "pass_manager.h" #include "dumpfile.h" +#include "realmpfr.h" /* The singleton holder of global state: */ gcc::context *g; @@ -42,4 +43,7 @@ gcc::context::~context () { delete m_passes; delete m_dumps; + + /* Release MPFR caches to avoid Valgrind leak reports. */ + mpfr_free_cache (); } |