From patchwork Wed May 27 13:56:50 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: 477128 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 5225B1400B7 for ; Thu, 28 May 2015 00:01:09 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=hTwGoHkh; 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 :resent-from:resent-to:resent-date:resent-message-id:message-id :in-reply-to:references:from:date:subject:to; q=dns; s=default; b= FZ6aUn8guSGSI0WMGETxA7CP5r9f0BA0ge6CVPn15cKGEZZkJpQUlbtGToXu8UsE Fyc4+QdYL2+msiPiEGPnYqdx3Pfrx4diqjhuOUyyogvx/hoOmND/WX96Niiukjdr dm+3vQdN7XFFXUvhfs9+HhBzNA6ReO+rsrDDlLfBQWI= 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 :resent-from:resent-to:resent-date:resent-message-id:message-id :in-reply-to:references:from:date:subject:to; s=default; bh=YEgt glCDgveTFE79N8VzJQUB/Lo=; b=hTwGoHkh0kkzL6M+oEQKyfq6l5CkKhG3FclE xeW0obQ04okck7VNKbJT17dP6O1+ypA/ClBQi+rqKE3OySSTjSJa9THfT+7E/ODp merKRdh6fYygVm5WCnI2A6JZy5UlHkf3/C5VKqn0sri56kq6o14M+MRQWIKrTXub 0NviAZc= Received: (qmail 70212 invoked by alias); 27 May 2015 14:00:14 -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 69824 invoked by uid 89); 27 May 2015 14:00:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.6 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; Wed, 27 May 2015 14:00:06 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 84797ADFC for ; Wed, 27 May 2015 13:59:57 +0000 (UTC) Resent-From: =?UTF-8?B?TWFydGluIExpxaFrYQ==?= Resent-To: GCC Patches Resent-Date: Wed, 27 May 2015 15:59:57 +0200 Resent-Message-ID: <5565CDDD.8080100@suse.cz> Resent-User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 Message-Id: <42eae98060e78c4a708528c7e8e5c0edab4eb5c9.1432735040.git.mliska@suse.cz> In-Reply-To: <83d59ba92a3c4b3ba831ebc2fce325f0416848d0.1432735040.git.mliska@suse.cz> References: <83d59ba92a3c4b3ba831ebc2fce325f0416848d0.1432735040.git.mliska@suse.cz> From: mliska Date: Wed, 27 May 2015 15:56:50 +0200 Subject: [PATCH 19/35] Change use to type-based pool allocator in sel-sched-ir.c. To: gcc-patches@gcc.gnu.org X-IsSubscribed: yes 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