Commit ac0539d7 by Martin Liska Committed by Martin Liska

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
parent 4fef8379
2015-06-01 Martin Liska <mliska@suse.cz> 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.c (asan_mem_ref_get_alloc_pool):Use new type-based pool allocator.
(asan_mem_ref_new) Likewise. (asan_mem_ref_new) Likewise.
(free_mem_ref_resources) Likewise. (free_mem_ref_resources) Likewise.
......
...@@ -1066,18 +1066,16 @@ static hash_table<bb_copy_hasher> *bb_copy; ...@@ -1066,18 +1066,16 @@ static hash_table<bb_copy_hasher> *bb_copy;
/* And between loops and copies. */ /* And between loops and copies. */
static hash_table<bb_copy_hasher> *loop_copy; 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 /* Initialize the data structures to maintain mapping between blocks
and its copies. */ and its copies. */
void void
initialize_original_copy_tables (void) initialize_original_copy_tables (void)
{ {
gcc_assert (!original_copy_bb_pool);
original_copy_bb_pool original_copy_bb_pool = new pool_allocator<htab_bb_copy_original_entry>
= create_alloc_pool ("original_copy", ("original_copy", 10);
sizeof (struct htab_bb_copy_original_entry), 10);
bb_original = new hash_table<bb_copy_hasher> (10); bb_original = new hash_table<bb_copy_hasher> (10);
bb_copy = 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); loop_copy = new hash_table<bb_copy_hasher> (10);
...@@ -1095,7 +1093,7 @@ free_original_copy_tables (void) ...@@ -1095,7 +1093,7 @@ free_original_copy_tables (void)
bb_copy = NULL; bb_copy = NULL;
delete loop_copy; delete loop_copy;
loop_copy = NULL; loop_copy = NULL;
free_alloc_pool (original_copy_bb_pool); delete original_copy_bb_pool;
original_copy_bb_pool = NULL; original_copy_bb_pool = NULL;
} }
...@@ -1117,7 +1115,7 @@ copy_original_table_clear (hash_table<bb_copy_hasher> *tab, unsigned obj) ...@@ -1117,7 +1115,7 @@ copy_original_table_clear (hash_table<bb_copy_hasher> *tab, unsigned obj)
elt = *slot; elt = *slot;
tab->clear_slot (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. /* 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, ...@@ -1137,8 +1135,7 @@ copy_original_table_set (hash_table<bb_copy_hasher> *tab,
slot = tab->find_slot (&key, INSERT); slot = tab->find_slot (&key, INSERT);
if (!*slot) if (!*slot)
{ {
*slot = (struct htab_bb_copy_original_entry *) *slot = original_copy_bb_pool->allocate ();
pool_alloc (original_copy_bb_pool);
(*slot)->index1 = obj; (*slot)->index1 = obj;
} }
(*slot)->index2 = val; (*slot)->index2 = val;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment