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

Simon Marchi simon.marchi@polymtl.ca
Fri Dec 13 15:18:00 GMT 2019


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



More information about the Gdb-patches mailing list