lttng: make session_storage::_array a unique_ptr to array
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 27 Jun 2023 16:39:42 +0000 (12:39 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 27 Jul 2023 18:15:29 +0000 (14:15 -0400)
By making this field a unique_ptr of lttng_session[] instead of
lttng_session, we can use the subscript operator on it, making the code
in session_list_operations a bit simpler.

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

index 000509da5f4ad2dacfec76c8525dbd5c02650fd5..75b91df196d76257565a5c009ae3b654591cfb9d 100644 (file)
@@ -66,7 +66,7 @@ public:
        {
        }
 
-       std::unique_ptr<lttng_session,
+       std::unique_ptr<lttng_session[],
                        lttng::memory::create_deleter_class<lttng_session, lttng::free>::deleter>
                _array = nullptr;
        std::size_t _count = 0;
@@ -77,7 +77,7 @@ public:
        static lttng_session& get(const lttng::cli::details::session_storage& storage,
                                  std::size_t index) noexcept
        {
-               return storage._array.get()[index];
+               return storage._array[index];
        }
 
        static std::size_t size(const lttng::cli::details::session_storage& storage)
This page took 0.026651 seconds and 4 git commands to generate.