From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 85098 invoked by alias); 13 Dec 2019 22:20:32 -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 85087 invoked by uid 89); 13 Dec 2019 22:20:32 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.1 spammy=stability X-HELO: us-smtp-delivery-1.mimecast.com Received: from us-smtp-1.mimecast.com (HELO us-smtp-delivery-1.mimecast.com) (207.211.31.81) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 13 Dec 2019 22:20:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576275629; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zCRZ/wsUCtWiBujLkngtNIUIEpgem1/k+bofW+sqGaQ=; b=CytrvNL0/lJO+OPzltjvdt+77KaHts2M9mS/4R7miBEAHwoahsmOepK9I+G6cUwIbg5esV rcUMB96UIoTaS4AbbZHdDDKvh3iMllmdZDht9UBqvcnyb4Tf5IhyY2ngRc0oyBCOCK0r3U PGv48USBC2zIokNwuOUyZMlmpPkrreg= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-321-DHDp7_s5Pe-vkSAC1ib4NQ-1; Fri, 13 Dec 2019 17:20:26 -0500 Received: by mail-wr1-f71.google.com with SMTP id h30so150920wrh.5 for ; Fri, 13 Dec 2019 14:20:25 -0800 (PST) Return-Path: Received: from ?IPv6:2001:8a0:f913:f700:56ee:75ff:fe8d:232b? ([2001:8a0:f913:f700:56ee:75ff:fe8d:232b]) by smtp.gmail.com with ESMTPSA id i8sm11681732wro.47.2019.12.13.14.20.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 13 Dec 2019 14:20:24 -0800 (PST) Subject: Re: [PATCH 6/7] jit: c++-ify gdb_block To: Simon Marchi , Christian Biesinger References: <20191213060323.1799590-1-simon.marchi@polymtl.ca> <20191213060323.1799590-7-simon.marchi@polymtl.ca> <06ec7caa-e2ed-e560-9456-0755d246633f@polymtl.ca> <85f3026a-f05f-c357-d760-0b7c7cd90a02@polymtl.ca> Cc: gdb-patches From: Pedro Alves Message-ID: Date: Fri, 13 Dec 2019 22:20:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <85f3026a-f05f-c357-d760-0b7c7cd90a02@polymtl.ca> X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-12/txt/msg00643.txt.bz2 On 12/13/19 9:01 PM, Simon Marchi wrote: > On 2019-12-13 3:57 p.m., Pedro Alves wrote: >> I wonder whether it wouldn't be simpler to use std::list for these cases. > > I don't think the code would be much different if use used a list, so I don't expect it > to be much simpler. If there's a compelling argument for using a list, I can do the > change, but if it's equivalent, I'd rather stick with what is already done. > It wouldn't be that much simpler, but simpler regardless, I believe. Instead of a vector of heap-allocated pointers, with means an extra levels of indirection and use of a unique_ptr to manage memory, the list would hold the objects directly, and you'd get address stability encoded in the data structure. I don't think changing it would be anything remotely complicated, since vector/list's apis are quite similar, if not the same for the uses here. Seems like a win to me. But I'm not unhappy with what you have. Thanks, Pedro Alves