From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 76299 invoked by alias); 29 May 2015 13:39:16 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 76225 invoked by uid 89); 29 May 2015 13:39:15 -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:39:10 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 1E259AC66; Fri, 29 May 2015 13:39:06 +0000 (UTC) Message-ID: <55686BF9.40503@suse.cz> Date: Fri, 29 May 2015 13:39:00 -0000 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: Jeff Law , gcc-patches@gcc.gnu.org Subject: Re: [PATCH 20/35] Change use to type-based pool allocator in ira-build.c. References: <83d59ba92a3c4b3ba831ebc2fce325f0416848d0.1432735040.git.mliska@suse.cz> <8a64b779e2d82b444eee21755545c8530c3322a3.1432735040.git.mliska@suse.cz> <55660901.3030408@redhat.com> In-Reply-To: <55660901.3030408@redhat.com> Content-Type: multipart/mixed; boundary="------------000603070501090101090208" X-IsSubscribed: yes X-SW-Source: 2015-05/txt/msg02775.txt.bz2 This is a multi-part message in MIME format. --------------000603070501090101090208 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Content-length: 376 On 05/27/2015 08:12 PM, Jeff Law wrote: > On 05/27/2015 07:56 AM, mliska wrote: >> gcc/ChangeLog: >> >> 2015-04-30 Martin Liska >> >> * ira-build.c (initiate_cost_vectors): Use new type-based pool allocator. >> (ira_allocate_cost_vector): Likewise. >> (ira_free_cost_vector): Likewise. >> (finish_cost_vectors): Likewise. > OK. > jeff > v2 --------------000603070501090101090208 Content-Type: text/x-patch; name="0019-Change-use-to-type-based-pool-allocator-in-ira-build.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0019-Change-use-to-type-based-pool-allocator-in-ira-build.pa"; filename*1="tch" Content-length: 2302 >From 3df359fb77e6e60341ef5f9dec2898708245f5ee Mon Sep 17 00:00:00 2001 From: mliska Date: Wed, 27 May 2015 15:56:51 +0200 Subject: [PATCH 19/32] Change use to type-based pool allocator in ira-build.c. gcc/ChangeLog: 2015-04-30 Martin Liska * ira-build.c (initiate_cost_vectors): Use new type-based pool allocator. (ira_allocate_cost_vector): Likewise. (ira_free_cost_vector): Likewise. (finish_cost_vectors): Likewise. --- gcc/ira-build.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/gcc/ira-build.c b/gcc/ira-build.c index 8b6b956..2de7d34 100644 --- a/gcc/ira-build.c +++ b/gcc/ira-build.c @@ -1633,7 +1633,7 @@ finish_copies (void) /* Pools for cost vectors. It is defined only for allocno classes. */ -static alloc_pool cost_vector_pool[N_REG_CLASSES]; +static pool_allocator * cost_vector_pool[N_REG_CLASSES]; /* The function initiates work with hard register cost vectors. It creates allocation pool for each allocno class. */ @@ -1646,10 +1646,9 @@ initiate_cost_vectors (void) for (i = 0; i < ira_allocno_classes_num; i++) { aclass = ira_allocno_classes[i]; - cost_vector_pool[aclass] - = create_alloc_pool ("cost vectors", - sizeof (int) * ira_class_hard_regs_num[aclass], - 100); + cost_vector_pool[aclass] = new pool_allocator + ("cost vectors", 100, + sizeof (int) * (ira_class_hard_regs_num[aclass] - 1)); } } @@ -1657,7 +1656,7 @@ initiate_cost_vectors (void) int * ira_allocate_cost_vector (reg_class_t aclass) { - return (int *) pool_alloc (cost_vector_pool[(int) aclass]); + return cost_vector_pool[(int) aclass]->allocate (); } /* Free a cost vector VEC for ACLASS. */ @@ -1665,7 +1664,7 @@ void ira_free_cost_vector (int *vec, reg_class_t aclass) { ira_assert (vec != NULL); - pool_free (cost_vector_pool[(int) aclass], vec); + cost_vector_pool[(int) aclass]->remove (vec); } /* Finish work with hard register cost vectors. Release allocation @@ -1679,7 +1678,7 @@ finish_cost_vectors (void) for (i = 0; i < ira_allocno_classes_num; i++) { aclass = ira_allocno_classes[i]; - free_alloc_pool (cost_vector_pool[aclass]); + delete cost_vector_pool[aclass]; } } -- 2.1.4 --------------000603070501090101090208--