This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 19/35] Change use to type-based pool allocator in sel-sched-ir.c.


On 05/27/2015 08:04 PM, Jeff Law wrote:
On 05/27/2015 07:56 AM, mliska wrote:
gcc/ChangeLog:

2015-04-30  Martin Liska  <mliska@suse.cz>

    * sel-sched-ir.c (alloc_sched_pools): Use new type-based pool allocator.
    (free_sched_pools): Likewise.
    * sel-sched-ir.h (_list_alloc): Likewise.
    (_list_remove): Likewise.
OK
jeff


v2
>From 9e5b4f84bb12652353c92827371645ca97be2a72 Mon Sep 17 00:00:00 2001
From: mliska <mliska@suse.cz>
Date: Wed, 27 May 2015 15:56:50 +0200
Subject: [PATCH 18/32] Change use to type-based pool allocator in
 sel-sched-ir.c.

gcc/ChangeLog:

2015-04-30  Martin Liska  <mliska@suse.cz>

	* sel-sched-ir.c (alloc_sched_pools): Use new type-based pool allocator.
	(free_sched_pools): Likewise.
	* sel-sched-ir.h (_list_alloc): Likewise.
	(_list_remove): Likewise.
---
 gcc/sel-sched-ir.c | 7 ++-----
 gcc/sel-sched-ir.h | 6 +++---
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c
index 94f6c43..ffaba56 100644
--- a/gcc/sel-sched-ir.c
+++ b/gcc/sel-sched-ir.c
@@ -70,7 +70,7 @@ vec<sel_region_bb_info_def>
     sel_region_bb_info = vNULL;
 
 /* A pool for allocating all lists.  */
-alloc_pool sched_lists_pool;
+pool_allocator<_list_node> sched_lists_pool ("sel-sched-lists", 500);
 
 /* This contains information about successors for compute_av_set.  */
 struct succs_info current_succs;
@@ -5030,9 +5030,6 @@ alloc_sched_pools (void)
   succs_info_pool.size = succs_size;
   succs_info_pool.top = -1;
   succs_info_pool.max_top = -1;
-
-  sched_lists_pool = create_alloc_pool ("sel-sched-lists",
-                                        sizeof (struct _list_node), 500);
 }
 
 /* Free the pools.  */
@@ -5041,7 +5038,7 @@ free_sched_pools (void)
 {
   int i;
 
-  free_alloc_pool (sched_lists_pool);
+  sched_lists_pool.release ();
   gcc_assert (succs_info_pool.top == -1);
   for (i = 0; i <= succs_info_pool.max_top; i++)
     {
diff --git a/gcc/sel-sched-ir.h b/gcc/sel-sched-ir.h
index 91ce92f..3707a87 100644
--- a/gcc/sel-sched-ir.h
+++ b/gcc/sel-sched-ir.h
@@ -364,12 +364,12 @@ struct _list_node
 /* _list_t functions.
    All of _*list_* functions are used through accessor macros, thus
    we can't move them in sel-sched-ir.c.  */
-extern alloc_pool sched_lists_pool;
+extern pool_allocator<_list_node> sched_lists_pool;
 
 static inline _list_t
 _list_alloc (void)
 {
-  return (_list_t) pool_alloc (sched_lists_pool);
+  return sched_lists_pool.allocate ();
 }
 
 static inline void
@@ -395,7 +395,7 @@ _list_remove (_list_t *lp)
   _list_t n = *lp;
 
   *lp = _LIST_NEXT (n);
-  pool_free (sched_lists_pool, n);
+  sched_lists_pool.remove (n);
 }
 
 static inline void
-- 
2.1.4


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]