Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Simon Marchi <simark@simark.ca>, gdb-patches@sourceware.org
Subject: Re: [PATCH v2] [gdb/symtab] Simplify memory management in parse_macro_definition
Date: Mon, 29 Jul 2024 18:13:05 +0200	[thread overview]
Message-ID: <78ab9c10-a0f4-4b23-8486-c9655f2194b8@suse.de> (raw)
In-Reply-To: <6619062a-4841-4e24-95d8-5ff7ec949088@suse.de>

On 7/24/24 18:12, Tom de Vries wrote:
> On 7/24/24 18:07, Simon Marchi wrote:
>> 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.
>>
> 
> Hi Simon,
> 
> thanks for the review.
> 
> No, not really, my main goal here is the ability to do a return in 
> parse_macro_definition without introducing a memory leak.
> 
> So that sounds fine to me.
> 

I've looked at the patch.

I've was thrown astray a bit about the macro_special_kind business, 
until I realized it was a pre-existing notion.

Anyway, patch LGTM.

Tested on x86_64-linux, no issues found.

Thanks,
- Tom


> Thanks,
> - Tom
> 
>> Here is it if you want to take a peek: 
>> https://review.lttng.org/c/binutils-gdb/+/13009
>>
>> Simon
> 


  reply	other threads:[~2024-07-29 16:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-26  6:32 Tom de Vries
2024-07-24 14:46 ` [PING] " Tom de Vries
2024-07-24 16:07 ` Simon Marchi
2024-07-24 16:12   ` Tom de Vries
2024-07-29 16:13     ` Tom de Vries [this message]
2024-07-29 16:28       ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=78ab9c10-a0f4-4b23-8486-c9655f2194b8@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox