From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by sourceware.org (Postfix) with ESMTPS id E6782393D025 for ; Wed, 28 Apr 2021 20:07:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E6782393D025 Received: by mail-pg1-x52b.google.com with SMTP id q10so45533106pgj.2 for ; Wed, 28 Apr 2021 13:07:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=DsrY32ZMexVzbMwq2cgLH4i+lt/O+tCg8KGdfay8Fvc=; b=a2ABABpUeYcfu7dRVPuR/WWtCEGIpzX+fhkbP/CjKlkAP1nNBO6rNxb2kdrLQNG9tB pRxOW+9SSw6RIcnPupTfPaVyXwrEOSTvI+XXCe0Jl1aW+uJzNffvo0LAkvdOSBeopi7j +Uq8oTVEOviuSnKcmV7YkTLT46q2tUzH7ZXjmoFPYyefNHuWMYJqnQeKLrlri6qwF1Vb V0Ev0ZXwoD6vM+HjRyg3Kd/dmM7KEUYzmKcwOuSPOrGOpDCdzOZOs4xEpYLvd6e1fb72 y0XZ5y1m8uOA+B5V7cBRmrtdD23lbKRQSXpP+xWmEOTxkTJkFNPzct53qA1/Uxu5KMYF APhA== X-Gm-Message-State: AOAM5305yx54YhfwskWIT9gSALR+ORfiat5FYZKWJDYbEqWiXEUJ6dpv 8voBmvyjZUGmzHeitAix2a55B3a5/klDxg== X-Google-Smtp-Source: ABdhPJxsfCrQQWwdz2+j8RHqKovZI7GS3ZyfNMP22uNJlZ3vQlpCxBoY9jwoJmjkkuuMUEWBqQ5RVw== X-Received: by 2002:a63:ce41:: with SMTP id r1mr13261456pgi.222.1619640430608; Wed, 28 Apr 2021 13:07:10 -0700 (PDT) Received: from [192.168.1.29] (65-130-82-141.slkc.qwest.net. [65.130.82.141]) by smtp.gmail.com with ESMTPSA id 5sm450714pfi.43.2021.04.28.13.07.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 Apr 2021 13:07:10 -0700 (PDT) Subject: Re: [PATCH v2 07/21] libcc1: use std::vector when building function types To: Tom Tromey Cc: gcc-patches@gcc.gnu.org References: <20210428010119.806184-1-tom@tromey.com> <20210428010119.806184-8-tom@tromey.com> <87k0omuqrc.fsf@tromey.com> From: Jeff Law Message-ID: <7e1be450-9241-c445-2f14-1acd431cdbba@gmail.com> Date: Wed, 28 Apr 2021 14:07:09 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: <87k0omuqrc.fsf@tromey.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, URIBL_CSS, URIBL_CSS_A autolearn=ham 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 20:07:13 -0000 On 4/28/2021 1:56 PM, Tom Tromey wrote: >>>>>> "Jeff" == 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. >>> >>> libcc1/ChangeLog >>> 2021-04-27 Tom Tromey >>> >>> * libcp1plugin.cc (plugin_build_function_type): Use std::vector. >>> * libcc1plugin.cc (plugin_build_function_type): Use std::vector. > Jeff> Does this really work?   In general we can't stuff GC'd objects into > Jeff> something like std::vector.  Though I guess in this instance the > 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. OK.  Then let's go with the patch as-is. jeff