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

Pedro Alves
2019-12-13T22:20:32Z

On 12/13/19 9:01 PM, Simon Marchi wrote:
> On 2019-12-13 3:57 p.m., Pedro Alves wrote:
>> I wonder whether it wouldn't be simpler to use std::list for these cases.
>
> I don't think the code would be much different if use used a list, so I don't expect it
> to be much simpler. If there's a compelling argument for using a list, I can do the
> change, but if it's equivalent, I'd rather stick with what is already done.
>

It wouldn't be that much simpler, but simpler regardless, I believe.
Instead of a vector of heap-allocated pointers, with means an extra levels of
indirection and use of a unique_ptr to manage memory, the list would hold
the objects directly, and you'd get address stability encoded in the
data structure. I don't think changing it would be anything remotely
complicated, since vector/list's apis are quite similar, if not the same
for the uses here. Seems like a win to me. But I'm not unhappy with
what you have.

Thanks,
Pedro Alves