From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 106770 invoked by alias); 13 Dec 2019 15:18:26 -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 106759 invoked by uid 89); 13 Dec 2019 15:18:26 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.1 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy=H*i:sk:CAPTJ0X, HX-Languages-Length:685 X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 13 Dec 2019 15:18:25 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id xBDFIGsW012319 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 13 Dec 2019 10:18:21 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca xBDFIGsW012319 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1576250302; bh=rJp5YKR6yugd2qnOLCWPxsl/JFJyJ89bbtMLXIs91yk=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=HAkFEqkccdeKlgWNkNTnriOg8P1xlNueECyFgUHu7CjeMjsmh157x9M5QiR7zsF+5 8DyrRUf9hXvKII2JVEvVh1ec+hzKQcuAqp/TBKhNbv6wgdMWIPu5PwF5OjEN7c9tcu aU7t/KnOHBiHO3j7Yu9bVLm/m0l45bw+kLve3IHc= Received: from [172.16.0.95] (192-222-181-218.qc.cable.ebox.net [192.222.181.218]) (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 CF9871E573; Fri, 13 Dec 2019 10:18:16 -0500 (EST) Subject: Re: [PATCH 6/7] jit: c++-ify gdb_block To: Christian Biesinger Cc: gdb-patches References: <20191213060323.1799590-1-simon.marchi@polymtl.ca> <20191213060323.1799590-7-simon.marchi@polymtl.ca> From: Simon Marchi Message-ID: <06ec7caa-e2ed-e560-9456-0755d246633f@polymtl.ca> Date: Fri, 13 Dec 2019 15:18:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2019-12/txt/msg00598.txt.bz2 On 2019-12-13 10:10 a.m., Christian Biesinger via gdb-patches wrote: >> @@ -455,10 +463,7 @@ struct gdb_symtab >> ~gdb_symtab () >> { >> for (gdb_block *gdb_block_iter : this->blocks) >> - { >> - xfree ((void *) gdb_block_iter->name); >> - xfree (gdb_block_iter); >> - } >> + delete gdb_block_iter; >> } >> > > Have you considered making this a vector of unique_ptrs, so you don't have > to manually delete them? Yes, it's done in the following patch. I went perhaps a bit overboard with the patch splitting, but I prefer to do these changes in many smaller patches, so that if something goes wrong, it's easier to identify the culprit. Simon