[Lldb-commits] [lldb] [lldb] Remove UnwindPlan::Row shared_ptrs (PR #132370)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Wed Mar 26 01:43:52 PDT 2025
labath wrote:
> This seems ok to me. I think a good follow-up might be to stop handing out row pointers in case somebody tries to store one in the future.
How would you achieve that? By returning copies of the Row? That seems wasteful..
I don't think there's much risk in persisting row. There are many places that construct unwind plans, but there's basically just one user of it -- `RegisterContextUnwind`. And if someone really wants to store them, he has two options -- make a copy of the row, or store a (shared) pointer to the entire unwind plan.
> The pointers won't be stable as the vector resizes, but rows in unique_ptrs seems like a poor use of memory as well.
They are unstable, but only during construction. What I'm actually thinking is to guarantee that UnwindPlans are immutable after construction. That's very important since they are cached, accessed from multiple threads and whatnot, and it would also guarantee pointer stability.
> If no one uses the SP stuff this is a good change.
They aren't, because I removed all the uses earlier :D
https://github.com/llvm/llvm-project/pull/132370
More information about the lldb-commits
mailing list