From 95f0238c5ed238d1c54db6ea000906c3c0c40d07 Mon Sep 17 00:00:00 2001 From: Roberto Scolaro Date: Mon, 22 Jul 2024 18:57:28 +0000 Subject: [PATCH] fix(libsinsp): pass shared_ptr by reference Signed-off-by: Roberto Scolaro --- userspace/libsinsp/sinsp.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/userspace/libsinsp/sinsp.h b/userspace/libsinsp/sinsp.h index 66632da5ae..0aeef29147 100644 --- a/userspace/libsinsp/sinsp.h +++ b/userspace/libsinsp/sinsp.h @@ -500,7 +500,7 @@ class SINSP_PUBLIC sinsp : public capture_stats_source @throws a sinsp_exception containing the error string is thrown in case of failure. */ - inline threadinfo_map_t::ptr_t get_thread_ref(int64_t tid, bool query_os_if_not_found = false, bool lookup_only = true, bool main_thread = false) + inline const threadinfo_map_t::ptr_t& get_thread_ref(int64_t tid, bool query_os_if_not_found = false, bool lookup_only = true, bool main_thread = false) { return m_thread_manager->get_thread_ref(tid, query_os_if_not_found, lookup_only, main_thread); } @@ -1126,7 +1126,7 @@ class SINSP_PUBLIC sinsp : public capture_stats_source // just for lookup reason. In that case, m_lastaccess_ts is not updated // and m_last_tinfo is not set. // - inline threadinfo_map_t::ptr_t find_thread(int64_t tid, bool lookup_only) + inline const threadinfo_map_t::ptr_t& find_thread(int64_t tid, bool lookup_only) { return m_thread_manager->find_thread(tid, lookup_only); }