Re: [PATCH 6/7] jit: c++-ify gdb_block

Simon Marchi
2019-12-13T15:18:26Z

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