From patchwork Wed May 27 13:56:51 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: 477162 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 1EB2114016A for ; Thu, 28 May 2015 00:20:55 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=CVUd2Thd; 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= xzb61cHJFE1ngEDff6MdeWlVcVRcNcphmb3Bafra+0e2QKgblhAzcneC2aPbANH4 vLRnAxl2va6cqU77cafvAxaXF8LHNacA2V6qIZ+km9IfD+MeACdk50O1FhRiw2kL 3akbba+8CxGRC94nAMcubRPDEHi4hPuTdf8OBjLpZm8= 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=3Tys raAU2arrEVsKGSdx/vbXMTo=; b=CVUd2ThdlEHbJQZPcysvEvRCldyaAkNUcMvQ 51vp+DMCDdCf1oEcTwFnzqCgsrFYnxkm8GLUh255LBvG7WItC8A/HW/ohlsUA3TS uTjMFdsRoxuahGH/UtoMRqT7hmkjrpUopg28OGh+CnKE/H30X1+J4YWPRrtE7nl+ a3Zq5mU= Received: (qmail 115562 invoked by alias); 27 May 2015 14:20:37 -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 109895 invoked by uid 89); 27 May 2015 14:20:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.7 required=5.0 tests=AWL, BAYES_50, KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 27 May 2015 14:20:08 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YxbsJ-0007M2-Rv for gcc-patches@gcc.gnu.org; Wed, 27 May 2015 10:00:15 -0400 Received: from cantor2.suse.de ([195.135.220.15]:57515 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxbsJ-00078k-MX for gcc-patches@gcc.gnu.org; Wed, 27 May 2015 10:00:03 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 6F25EAE0E for ; Wed, 27 May 2015 14:00:00 +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.8020509@suse.cz> Resent-User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 Message-Id: <8a64b779e2d82b444eee21755545c8530c3322a3.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:51 +0200 Subject: [PATCH 20/35] Change use to type-based pool allocator in ira-build.c. To: gcc-patches@gcc.gnu.org X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 195.135.220.15 X-IsSubscribed: yes 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]; } }