From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gateway21.websitewelcome.com (gateway21.websitewelcome.com [192.185.45.212]) by sourceware.org (Postfix) with ESMTPS id B598C393C856 for ; Wed, 28 Apr 2021 19:56:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B598C393C856 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=tom@tromey.com Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway21.websitewelcome.com (Postfix) with ESMTP id 299A2400D9C1A for ; Wed, 28 Apr 2021 14:56:57 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id bqIrl6Ttpw11MbqIrlT1Lf; Wed, 28 Apr 2021 14:56:57 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID: In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=4PbDb52wL1sV8BB11lH/c1z62czb9tp9c7Dqir2AjFk=; b=k+0GYm8dYuughIg9RXyWUjz8sl lfpCtEp44RwoU6JCsRccYw/wghNb6/Lea5DfuJ+AYseOOs1S4nQnyKu7bb5s/g8K45pDxANVJntN2 S3aC0SuED6WsZq+7nRiNr5n67; Received: from 97-122-70-176.hlrn.qwest.net ([97.122.70.176]:45394 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1lbqIq-001ke5-Od; Wed, 28 Apr 2021 13:56:56 -0600 From: Tom Tromey To: Jeff Law Cc: Tom Tromey , gcc-patches@gcc.gnu.org Subject: Re: [PATCH v2 07/21] libcc1: use std::vector when building function types References: <20210428010119.806184-1-tom@tromey.com> <20210428010119.806184-8-tom@tromey.com> X-Attribution: Tom Date: Wed, 28 Apr 2021 13:56:55 -0600 In-Reply-To: (Jeff Law's message of "Wed, 28 Apr 2021 10:01:57 -0600") Message-ID: <87k0omuqrc.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - gcc.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.70.176 X-Source-L: No X-Exim-ID: 1lbqIq-001ke5-Od X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-70-176.hlrn.qwest.net (murgatroyd) [97.122.70.176]:45394 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-3024.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_SBL_CSS, SPF_HELO_PASS, SPF_NEUTRAL, TXREP, URIBL_CSS, URIBL_CSS_A autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 19:57:09 -0000 >>>>> "Jeff" =3D=3D Jeff Law writes: Jeff> On 4/27/2021 7:01 PM, Tom Tromey wrote: >> This changes libcc1 to use std::vector in the code that builds >> function types. This avoids some explicit memory management. >>=20 >> libcc1/ChangeLog >> 2021-04-27 Tom Tromey >>=20 >> * libcp1plugin.cc (plugin_build_function_type): Use std::vector. >> * libcc1plugin.cc (plugin_build_function_type): Use std::vector. Jeff> Does this really work?=C2=A0=C2=A0 In general we can't stuff GC'd obj= ects into Jeff> something like std::vector.=C2=A0 Though I guess in this instance the= =20 Jeff> lifetime is limited and we don't have to worry about the GC system? It's the latter. The patch doesn't really change whether or not the elements of the array are visible to the GC. It just changes how the vector is managed -- from manual use of new/delete to automatic via vector. The plugins do need to interface with the GC, but this is done by registering GC'able objects in a global hash table that is manually marked; see the 'preserve' and 'mark' methods on the plugin context objects. thanks, Tom