[all-commits] [llvm/llvm-project] 68fd10: [lldb] Use std::make_shared for StopInfoSP (#149612)

Jonas Devlieghere via All-commits all-commits at lists.llvm.org
Fri Jul 18 16:16:00 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 68fd102598a27e2654c0ced9c122c601795097fe
      https://github.com/llvm/llvm-project/commit/68fd102598a27e2654c0ced9c122c601795097fe
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2025-07-18 (Fri, 18 Jul 2025)

  Changed paths:
    M lldb/source/Target/StopInfo.cpp

  Log Message:
  -----------
  [lldb] Use std::make_shared for StopInfoSP (#149612)

Use std::make_shared to create a StopInfoSP, which inherits from
shared_from_this. It's both the most efficient and safest way to create
these objects:

- With make_shared, the object and the control block are allocated
together, which is more efficient.
- With make_shared, the enable_shared_from_this base class is properly
linked to the control block before the constructor finishes, so
shared_from_this() will be safe to use (though still not recommended
during construction).



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list