diff options
author | Richard Guenther <rguenther@suse.de> | 2006-06-20 16:19:29 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2006-06-20 16:19:29 +0000 |
commit | 5a6ccafd7d4899ee7942a5f3be359a249c1273ae (patch) | |
tree | 9147dcee09484286cbe9b33011aa8f2b85f12e02 /gcc/alloc-pool.c | |
parent | 1000b34d95a6319206389feb136879d42d4675f2 (diff) | |
download | gcc-5a6ccafd7d4899ee7942a5f3be359a249c1273ae.zip gcc-5a6ccafd7d4899ee7942a5f3be359a249c1273ae.tar.gz gcc-5a6ccafd7d4899ee7942a5f3be359a249c1273ae.tar.bz2 |
alloc-pool.h (free_alloc_pool_if_empty): Prototype new function.
2006-06-20 Richard Guenther <rguenther@suse.de>
Michael Matz <matz@suse.de>
* alloc-pool.h (free_alloc_pool_if_empty): Prototype new
function.
* alloc-pool.c (free_alloc_pool_if_empty): New function.
* et-forest.h (et_free_pools): Prototype new function.
* et-forest.c (et_free_tree_force): Free parent occurrence.
(et_free_pools): New function.
* dominance.c (free_dominance_info): Free et-forest alloc
pools.
Co-Authored-By: Michael Matz <matz@suse.de>
From-SVN: r114817
Diffstat (limited to 'gcc/alloc-pool.c')
-rw-r--r-- | gcc/alloc-pool.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/alloc-pool.c b/gcc/alloc-pool.c index 17d4073..d85cd9e 100644 --- a/gcc/alloc-pool.c +++ b/gcc/alloc-pool.c @@ -207,6 +207,17 @@ free_alloc_pool (alloc_pool pool) free (pool); } +/* Frees the alloc_pool, if it is empty and zero *POOL in this case. */ +void +free_alloc_pool_if_empty (alloc_pool *pool) +{ + if ((*pool)->elts_free == (*pool)->elts_allocated) + { + free_alloc_pool (*pool); + *pool = NULL; + } +} + /* Allocates one element from the pool specified. */ void * pool_alloc (alloc_pool pool) |