[PATCH 02/40] Eliminate make_cleanup_obstack_free, introduce auto_obstack

Pedro Alves palves@redhat.com
Tue Jun 27 10:25:00 GMT 2017


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



More information about the Gdb-patches mailing list