diff options
author | Martin Liska <mliska@suse.cz> | 2015-06-01 14:38:23 +0200 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2015-06-01 12:38:23 +0000 |
commit | ac0539d7ac678bb4f7adbebb2e69ee96edf84523 (patch) | |
tree | 0ae5a0c5ae49366cb885b4bd6d2c41ab036e21de /gcc | |
parent | 4fef8379d7e4587d4ae77e5b82cf47498da23dda (diff) | |
download | gcc-ac0539d7ac678bb4f7adbebb2e69ee96edf84523.zip gcc-ac0539d7ac678bb4f7adbebb2e69ee96edf84523.tar.gz gcc-ac0539d7ac678bb4f7adbebb2e69ee96edf84523.tar.bz2 |
Change use to type-based pool allocator in cfg.c.
* cfg.c (initialize_original_copy_tables):Use new type-based pool allocator.
(free_original_copy_tables) Likewise.
(copy_original_table_clear) Likewise.
(copy_original_table_set) Likewise.
From-SVN: r223950
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cfg.c | 17 |
2 files changed, 14 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e1bdc4e..ef7e40a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,12 @@ 2015-06-01 Martin Liska <mliska@suse.cz> + * cfg.c (initialize_original_copy_tables):Use new type-based pool allocator. + (free_original_copy_tables) Likewise. + (copy_original_table_clear) Likewise. + (copy_original_table_set) Likewise. + +2015-06-01 Martin Liska <mliska@suse.cz> + * asan.c (asan_mem_ref_get_alloc_pool):Use new type-based pool allocator. (asan_mem_ref_new) Likewise. (free_mem_ref_resources) Likewise. @@ -1066,18 +1066,16 @@ static hash_table<bb_copy_hasher> *bb_copy; /* And between loops and copies. */ static hash_table<bb_copy_hasher> *loop_copy; -static alloc_pool original_copy_bb_pool; - +static pool_allocator<htab_bb_copy_original_entry> *original_copy_bb_pool; /* Initialize the data structures to maintain mapping between blocks and its copies. */ void initialize_original_copy_tables (void) { - gcc_assert (!original_copy_bb_pool); - original_copy_bb_pool - = create_alloc_pool ("original_copy", - sizeof (struct htab_bb_copy_original_entry), 10); + + original_copy_bb_pool = new pool_allocator<htab_bb_copy_original_entry> + ("original_copy", 10); bb_original = new hash_table<bb_copy_hasher> (10); bb_copy = new hash_table<bb_copy_hasher> (10); loop_copy = new hash_table<bb_copy_hasher> (10); @@ -1095,7 +1093,7 @@ free_original_copy_tables (void) bb_copy = NULL; delete loop_copy; loop_copy = NULL; - free_alloc_pool (original_copy_bb_pool); + delete original_copy_bb_pool; original_copy_bb_pool = NULL; } @@ -1117,7 +1115,7 @@ copy_original_table_clear (hash_table<bb_copy_hasher> *tab, unsigned obj) elt = *slot; tab->clear_slot (slot); - pool_free (original_copy_bb_pool, elt); + original_copy_bb_pool->remove (elt); } /* Sets the value associated with OBJ in table TAB to VAL. @@ -1137,8 +1135,7 @@ copy_original_table_set (hash_table<bb_copy_hasher> *tab, slot = tab->find_slot (&key, INSERT); if (!*slot) { - *slot = (struct htab_bb_copy_original_entry *) - pool_alloc (original_copy_bb_pool); + *slot = original_copy_bb_pool->allocate (); (*slot)->index1 = obj; } (*slot)->index2 = val; |