src.ctf.fs: remove ctf_fs_ds_index_destroy
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 9 Jun 2022 13:24:46 +0000 (09:24 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 17 Apr 2024 17:57:53 +0000 (13:57 -0400)
Remove ctf_fs_ds_index_destroy and ctf_fs_ds_index_deleter, since
ctf_fs_ds_index objects can simply be deleted now.

Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Change-Id: I64eb93eb3f06174523e7f9ceaf94cf103a9e69eb
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8255
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12293

src/plugins/ctf/fs-src/data-stream-file.cpp
src/plugins/ctf/fs-src/data-stream-file.hpp

index f62bbd292b2acbf34bb9fc2da1986f01121f5660..ade19487620e2095cad711a15bb479ad90e80e26 100644 (file)
@@ -868,7 +868,7 @@ end:
 
 ctf_fs_ds_index::UP ctf_fs_ds_index_create()
 {
-    return ctf_fs_ds_index::UP {new ctf_fs_ds_index};
+    return bt2s::make_unique<ctf_fs_ds_index>();
 }
 
 void ctf_fs_ds_file_destroy(struct ctf_fs_ds_file *ds_file)
@@ -887,20 +887,6 @@ void ctf_fs_ds_file_destroy(struct ctf_fs_ds_file *ds_file)
     delete ds_file;
 }
 
-void ctf_fs_ds_index_destroy(struct ctf_fs_ds_index *index)
-{
-    if (!index) {
-        return;
-    }
-
-    delete index;
-}
-
-void ctf_fs_ds_index_deleter::operator()(ctf_fs_ds_index * const index) noexcept
-{
-    ctf_fs_ds_index_destroy(index);
-}
-
 ctf_fs_ds_file_info::UP ctf_fs_ds_file_info_create(const char *path, int64_t begin_ns)
 {
     ctf_fs_ds_file_info::UP ds_file_info = bt2s::make_unique<ctf_fs_ds_file_info>();
index 3059933c8e1132c305dd3aa6d077839e4d795c61..8eadd236ce8eeeb28655988c4c08c87809571861 100644 (file)
@@ -108,14 +108,9 @@ struct ctf_fs_ds_index_entry
     uint64_t packet_seq_num = 0;
 };
 
-struct ctf_fs_ds_index_deleter
-{
-    void operator()(struct ctf_fs_ds_index *index) noexcept;
-};
-
 struct ctf_fs_ds_index
 {
-    using UP = std::unique_ptr<ctf_fs_ds_index, ctf_fs_ds_index_deleter>;
+    using UP = std::unique_ptr<ctf_fs_ds_index>;
 
     std::vector<ctf_fs_ds_index_entry::UP> entries;
 };
@@ -164,8 +159,6 @@ ctf_fs_ds_index::UP ctf_fs_ds_file_build_index(struct ctf_fs_ds_file *ds_file,
 
 ctf_fs_ds_index::UP ctf_fs_ds_index_create();
 
-void ctf_fs_ds_index_destroy(struct ctf_fs_ds_index *index);
-
 ctf_fs_ds_file_info::UP ctf_fs_ds_file_info_create(const char *path, int64_t begin_ns);
 
 ctf_fs_ds_file_group::UP ctf_fs_ds_file_group_create(struct ctf_fs_trace *ctf_fs_trace,
This page took 0.025925 seconds and 4 git commands to generate.