Replace the lwp_free function with a destructor. Make lwp_info
non-copyable, since there is now a destructor (we wouldn't want an
lwp_info object getting copied and this->arch_private getting deleted
twice).
Change-Id: I09fcbe967e362566d3a06fed2abca2a9955570fa
/* Destroy and free LP. */
-static void
-lwp_free (struct lwp_info *lp)
+lwp_info::~lwp_info ()
{
/* Let the arch specific bits release arch_lwp_info. */
- linux_target->low_delete_thread (lp->arch_private);
-
- xfree (lp);
+ linux_target->low_delete_thread (this->arch_private);
}
/* Traversal function for purge_lwp_list. */
{
htab_clear_slot (lwp_lwpid_htab, slot);
lwp_list_remove (lp);
- lwp_free (lp);
+ delete lp;
}
return 1;
lwp_list_remove (lp);
/* Release. */
- lwp_free (lp);
+ delete lp;
}
/* Return a pointer to the structure describing the LWP corresponding
waitstatus.kind = TARGET_WAITKIND_IGNORE;
}
+ ~lwp_info ();
+
+ DISABLE_COPY_AND_ASSIGN (lwp_info);
+
/* The process id of the LWP. This is a combination of the LWP id
and overall process id. */
ptid_t ptid;