From patchwork Fri May 29 13:38:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 477896 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 419B8140F96 for ; Fri, 29 May 2015 23:39:12 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=I9wld9Cu; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:references :in-reply-to:content-type; q=dns; s=default; b=ENbygUdDPgb2Kh8oA O+0v4MHAvBgcKOJUrLIrXADBbXYY8LSxaZCx6Pbazm27AyCSVpCiLYufzZWhs/yX ZMTQcY87pkUzDzXnScz9RGMSxD+ssa6gdm0ek6o+6Um/QkgzHqEQvJxC4HJ7fGYQ njLsxlDcj4pKWFrgX7uoHKPHdw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:references :in-reply-to:content-type; s=default; bh=gcGkjlYz7nTXBk8zWnWdi6f QACU=; b=I9wld9CuH07K5iFPFjIN7Jur7mMbdjmWBTrRdrtfmkks2oYfNvcUKRm jFa3u0v94jWzXcAunN6xa/09GQlNPp1gQuIT9FQDWIlsw+VK/haUkwbkEiXHkvcq TuzNKv+sr43TTzfsivY2ARBAd0oDmIrxDa1GBeBLLX3b5mNyesmw= Received: (qmail 74599 invoked by alias); 29 May 2015 13:39:00 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 74479 invoked by uid 89); 29 May 2015 13:38:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.8 required=5.0 tests=AWL, BAYES_50, KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 X-HELO: mx2.suse.de Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Fri, 29 May 2015 13:38:56 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id BB640AC69 for ; Fri, 29 May 2015 13:38:52 +0000 (UTC) Message-ID: <55686BEC.5060807@suse.cz> Date: Fri, 29 May 2015 15:38:52 +0200 From: =?windows-1252?Q?Martin_Li=9Aka?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org Subject: Re: [PATCH 19/35] Change use to type-based pool allocator in sel-sched-ir.c. References: <83d59ba92a3c4b3ba831ebc2fce325f0416848d0.1432735040.git.mliska@suse.cz> <42eae98060e78c4a708528c7e8e5c0edab4eb5c9.1432735040.git.mliska@suse.cz> <5566074A.4050906@redhat.com> In-Reply-To: <5566074A.4050906@redhat.com> X-IsSubscribed: yes 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 >> >> * 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 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 * 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 = 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