Move lttng_session unique_ptr to lttng/session-internal.hpp
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 27 Jun 2023 17:02:04 +0000 (13:02 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 27 Jul 2023 18:15:44 +0000 (14:15 -0400)
Make it possible to use this unique_ptr elsewhere.

Change-Id: I30141efac45d842f4bc3414ca03fffb2e4ba5cce
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
include/lttng/session-internal.hpp
src/bin/lttng/utils.hpp

index e7530d3ae8b4c8b2b5ad77809507ed881c823b92..aead01b78137796a349d0ee9757e73b9c0434d0b 100644 (file)
@@ -9,9 +9,12 @@
 #define LTTNG_SESSION_INTERNAL_H
 
 #include <common/macros.hpp>
+#include <common/make-unique-wrapper.hpp>
 
 #include <lttng/constant.h>
 
+struct lttng_session;
+
 struct lttng_session_extended {
        struct {
                uint64_t value;
@@ -19,4 +22,8 @@ struct lttng_session_extended {
        } LTTNG_PACKED creation_time;
 } LTTNG_PACKED;
 
+using lttng_session_uptr =
+       std::unique_ptr<lttng_session[],
+                       lttng::memory::create_deleter_class<lttng_session, lttng::free>::deleter>;
+
 #endif /* LTTNG_SESSION_INTERNAL_H */
index 75b91df196d76257565a5c009ae3b654591cfb9d..0f42ef74e1269803a2d3aff262830f1b29ea790b 100644 (file)
@@ -14,6 +14,7 @@
 #include <common/make-unique-wrapper.hpp>
 
 #include <lttng/lttng.h>
+#include <lttng/session-internal.hpp>
 
 #include <iterator>
 #include <memory>
@@ -66,9 +67,7 @@ public:
        {
        }
 
-       std::unique_ptr<lttng_session[],
-                       lttng::memory::create_deleter_class<lttng_session, lttng::free>::deleter>
-               _array = nullptr;
+       lttng_session_uptr _array = nullptr;
        std::size_t _count = 0;
 };
 
This page took 0.037022 seconds and 4 git commands to generate.