[Lldb-commits] [PATCH] D120321: [lldb] Modernize ThreadLauncher

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Feb 23 05:23:46 PST 2022


labath added inline comments.


================
Comment at: lldb/source/Host/common/HostNativeThreadBase.cpp:55-56
 HostNativeThreadBase::ThreadCreateTrampoline(lldb::thread_arg_t arg) {
-  ThreadLauncher::HostThreadCreateInfo *info =
-      (ThreadLauncher::HostThreadCreateInfo *)arg;
-  llvm::set_thread_name(info->thread_name);
-
-  thread_func_t thread_fptr = info->thread_fptr;
-  thread_arg_t thread_arg = info->thread_arg;
+  std::unique_ptr<ThreadLauncher::HostThreadCreateInfo> info_up(
+      (ThreadLauncher::HostThreadCreateInfo *)arg);
+  llvm::set_thread_name(info_up->thread_name);
----------------
JDevlieghere wrote:
> make_unique maybe?
This isn't creating a new object. It's taking ownership of an object that was created in the caller (and passed disguised as a `void*`).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120321/new/

https://reviews.llvm.org/D120321



More information about the lldb-commits mailing list