This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 02/40] Eliminate make_cleanup_obstack_free, introduce auto_obstack
- From: Pedro Alves <palves at redhat dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 27 Jun 2017 11:25:00 +0100
- Subject: Re: [PATCH 02/40] Eliminate make_cleanup_obstack_free, introduce auto_obstack
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=palves at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 5AED34AE9A
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5AED34AE9A
- References: <1496406158-12663-1-git-send-email-palves@redhat.com> <1496406158-12663-3-git-send-email-palves@redhat.com> <86o9tax3m1.fsf@gmail.com>
On 06/26/2017 02:47 PM, Yao Qi wrote:
> Pedro Alves <palves@redhat.com> writes:
>
> [I am not sure how many patches in the series I can review, so I may
> stop at any point.]
Thanks. I think patches #1 to #10 and #19 to #23 (inclusive), could
go in independently of the main completer and symbol lookup changes.
>
>> These changes in the parsers may not be obvious:
>>
>> - obstack_init (&name_obstack);
>> - make_cleanup_obstack_free (&name_obstack);
>> + name_obstack.clear ();
>>
>> Here, the 'name_obstack' variable is a global. The change means that
>> the obstack's contents from a previous parse will stay around until
>> the next parsing starts. I.e., memory won't be reclaimed until them.
>> I don't think that's a problem, these objects don't really grow much
>> at all.
>
> I don't have a better solution to this, so I have to say that your patch
> is good enough. Patch is good to me.
Thanks, I've pushed this one in.
--
Pedro Alves