diff options
author | Tom Tromey <tom@tromey.com> | 2020-12-11 09:21:53 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2020-12-11 09:21:53 -0700 |
commit | 15f4dddd8a29d064a634140a5fcb830715681889 (patch) | |
tree | bc061cf0adce7754613f007f22e9bfc03eb7b52e /gdb/gdbthread.h | |
parent | a9f14fa5499a9f8d089c188f72c154de731551a0 (diff) | |
download | gdb-15f4dddd8a29d064a634140a5fcb830715681889.zip gdb-15f4dddd8a29d064a634140a5fcb830715681889.tar.gz gdb-15f4dddd8a29d064a634140a5fcb830715681889.tar.bz2 |
Use thread_info_ref in enable_thread_stack_temporaries
This changes enable_thread_stack_temporaries to use a thread_info_ref,
removing some manual reference counting.
gdb/ChangeLog
2020-12-11 Tom Tromey <tom@tromey.com>
* gdbthread.h (class enable_thread_stack_temporaries) <m_thr>:
Change type.
Diffstat (limited to 'gdb/gdbthread.h')
-rw-r--r-- | gdb/gdbthread.h | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h index e5484ac..386b50a 100644 --- a/gdb/gdbthread.h +++ b/gdb/gdbthread.h @@ -711,12 +711,8 @@ class enable_thread_stack_temporaries public: explicit enable_thread_stack_temporaries (struct thread_info *thr) - : m_thr (thr) + : m_thr (thread_info_ref::new_reference (thr)) { - gdb_assert (m_thr != NULL); - - m_thr->incref (); - m_thr->stack_temporaries_enabled = true; m_thr->stack_temporaries.clear (); } @@ -725,15 +721,13 @@ public: { m_thr->stack_temporaries_enabled = false; m_thr->stack_temporaries.clear (); - - m_thr->decref (); } DISABLE_COPY_AND_ASSIGN (enable_thread_stack_temporaries); private: - struct thread_info *m_thr; + thread_info_ref m_thr; }; extern bool thread_stack_temporaries_enabled_p (struct thread_info *tp); |