From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 76539 invoked by alias); 12 Feb 2020 03:53:56 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 76460 invoked by uid 89); 12 Feb 2020 03:53:55 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-5.3 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 12 Feb 2020 03:53:53 +0000 Received: from [10.0.0.11] (unknown [192.222.164.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id BB54B1ED42; Tue, 11 Feb 2020 22:53:51 -0500 (EST) Subject: Re: [PATCH 5/8] Add per-unit obstack To: Tom Tromey , gdb-patches@sourceware.org References: <20200208152758.29385-1-tom@tromey.com> <20200208152758.29385-6-tom@tromey.com> From: Simon Marchi Message-ID: <8e13cd77-cbe8-4549-5ff3-2cb5fbe32b47@simark.ca> Date: Wed, 12 Feb 2020 03:53:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: <20200208152758.29385-6-tom@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2020-02/txt/msg00436.txt.bz2 On 2020-02-08 10:27 a.m., Tom Tromey wrote: > This adds an auto_obstack to the DWARF frame comp_unit object, and > then changes the remaining code here to use the comp_unit obstack > rather than the objfile obstack. > > At this point, all the storage for frame data is self-contained -- > that is, it is independent of the objfile. Would it be simpler to eliminate the obstack by making dwarf2_cie_table and dwarf2_fde_table hold objects instead of pointers? On top of that, it should be good for performance as well, at least when doing lookups. The only issue is that dwarf2_cie objects are referenced by address by the FDEs, so we must make sure they don't get moved by the container. But I believe std::unordered_map guarantees that (disabling copy and assign on dwarf2_cie would verify it). Or worst case, the it could be an std::unordered_map of std::unique_ptr. Simon