From 7b24b675378a69ff254e4a4b5faa3615d4abd84d Mon Sep 17 00:00:00 2001 From: Teresa Johnson Date: Thu, 11 Jul 2013 21:32:14 +0000 Subject: [PATCH] This patch adds a call to ggc_free from va_gc::release, which is called by vec_free. This patch adds a call to ggc_free from va_gc::release, which is called by vec_free. This restores the functionality of the old VEC_free and reduces the memory footprint during compilation. 2013-07-11 Teresa Johnson * vec.h (struct va_gc): Move release out-of-line. (va_gc::release): Call ggc_free on released vec. From-SVN: r200909 --- gcc/ChangeLog | 5 +++++ gcc/vec.h | 14 +++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 30f63c4b4da..4454b01a50a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2013-07-11 Teresa Johnson + + * vec.h (struct va_gc): Move release out-of-line. + (va_gc::release): Call ggc_free on released vec. + 2013-07-11 Ulrich Weigand * config/rs6000/rs6000.md (""*tls_gd_low"): diff --git a/gcc/vec.h b/gcc/vec.h index 3c1bb9a3d6b..09a1d0a4d86 100644 --- a/gcc/vec.h +++ b/gcc/vec.h @@ -337,10 +337,22 @@ struct va_gc CXX_MEM_STAT_INFO); template - static void release (vec *&v) { v = NULL; } + static void release (vec *&v); }; +/* Free GC memory used by V and reset V to NULL. */ + +template +inline void +va_gc::release (vec *&v) +{ + if (v) + ::ggc_free (v); + v = NULL; +} + + /* Allocator for GC memory. Ensure there are at least RESERVE free slots in V. If EXACT is true, grow exactly, else grow exponentially. As a special case, if the vector had not been -- 2.30.2