From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id bULRKtEmoWbriDAAWB0awg (envelope-from ) for ; Wed, 24 Jul 2024 12:07:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1721837265; bh=GPLtoY9jTpBEXsNUMu98i8hQkt3YJ3NBCb77NqiEPr0=; h=Date:Subject:To:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=vfs11X48EUrKcOWbDNs/FBlYUw+bcJ7hLMH03rRxsDvWA4YQ5iYNR2aIzcRINlQ52 JhSA3hAO3E69Fs/tEHBg/xJn0JFlJbHGO7EOwZIYjD81cg9PwhvBmI0iK0JmxYFZcO Qs8yf+hC2W9AraGNMrSTmg1zEHxxy5PhXY2u5HyE= Received: by simark.ca (Postfix, from userid 112) id A564E1E0C3; Wed, 24 Jul 2024 12:07:45 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=nWeouf5R; dkim-atps=neutral Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 827A01E097 for ; Wed, 24 Jul 2024 12:07:43 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 41E5A3858D29 for ; Wed, 24 Jul 2024 16:07:43 +0000 (GMT) Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id C7A2E3858D29 for ; Wed, 24 Jul 2024 16:07:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C7A2E3858D29 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C7A2E3858D29 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721837244; cv=none; b=mIY21FgtUwuBHTBtHvtoSb0Q8/Gvqqg3LE9KRq1sGmSa3q3qi3iBsyVpq9qB6EhIy0pmX6Ad6X63ABVW0wWKZVT11YjQFO00Q1ACSNrbScpho0lUdK2vGNvD2Vfg2I+/wsfvFj7+pai58NYkqADWs+zsCe6zXNp/jkTg2cdySTk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721837244; c=relaxed/simple; bh=GPLtoY9jTpBEXsNUMu98i8hQkt3YJ3NBCb77NqiEPr0=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=sydLHMvd9iG1Js6b3IotRdxDUYEWrxt3nnyMqIFLkzykFMqFlVhOkHleuxW0ISB2Brh6dNDg4kGjuNvqSQtNDotOw3scrxnyyOjoyk2RL4yFVbkrENbJuY1WkxdDaiyPti/tOP1tK69kt7BzOu2b+e0tdMNkSu3jRk+onquu0Y8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1721837237; bh=GPLtoY9jTpBEXsNUMu98i8hQkt3YJ3NBCb77NqiEPr0=; h=Date:Subject:To:References:From:In-Reply-To:From; b=nWeouf5Rtfd6fMsnJxYcS3oooJqtbbouj5SmkB67EfCDievx1P/aThIAnsIcWPZkG B3dHf3xhaD3P/X3Jzlbv5JqZb9BYUz8GBm/LrDCgcbk1faiUBfja6hq8vq7gSNdl4S 3q/RTnBM90kHk465K69fD3XlUZrQfuUf+yXpahZY= Received: from [172.16.0.192] (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 0C1FB1E097; Wed, 24 Jul 2024 12:07:16 -0400 (EDT) Message-ID: <91690c44-2946-4413-be8d-9f94b8435641@simark.ca> Date: Wed, 24 Jul 2024 12:07:16 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] [gdb/symtab] Simplify memory management in parse_macro_definition To: Tom de Vries , gdb-patches@sourceware.org References: <20240626063233.19408-1-tdevries@suse.de> Content-Language: fr From: Simon Marchi In-Reply-To: <20240626063233.19408-1-tdevries@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 6/26/24 2:32 AM, Tom de Vries wrote: > I noticed that parse_macro_definition does malloc and free, both for the > argv array and its elements. > > Make memory management simpler by introducing a new class > vector_c_string (copied from temporary_macro_definition here [1]) that uses an > std::vector for the argv array. Is there a reason to keep using C strings here, instead of a let's say, a vector of std::string? I gave it a quick try, I have something that builds, just need to test and polish it. Here is it if you want to take a peek: https://review.lttng.org/c/binutils-gdb/+/13009 Simon