} 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>;
+using lttng_session_uptr = std::unique_ptr<
+ lttng_session[],
+ lttng::memory::create_deleter_class<lttng_session, lttng::memory::free>::deleter>;
#endif /* LTTNG_SESSION_INTERNAL_H */
namespace {
struct rotation_thread_job {
- using uptr = std::unique_ptr<
- rotation_thread_job,
- lttng::memory::create_deleter_class<rotation_thread_job, lttng::free>::deleter>;
+ using uptr =
+ std::unique_ptr<rotation_thread_job,
+ lttng::memory::create_deleter_class<rotation_thread_job,
+ lttng::memory::free>::deleter>;
enum ls::rotation_thread_job_type type;
struct ltt_session *session;
struct ust_app_channel *ua_chan;
struct ust_app_session *ua_sess;
auto ust_ctl_context_fields =
- lttng::make_unique_wrapper<lttng_ust_ctl_field, lttng::free>(raw_context_fields);
+ lttng::make_unique_wrapper<lttng_ust_ctl_field, lttng::memory::free>(
+ raw_context_fields);
lttng::urcu::read_lock_guard read_lock_guard;
struct ust_app_channel *ua_chan;
struct ust_app_session *ua_sess;
lttng::urcu::read_lock_guard rcu_lock;
- auto signature = lttng::make_unique_wrapper<char, lttng::free>(raw_signature);
- auto fields = lttng::make_unique_wrapper<lttng_ust_ctl_field, lttng::free>(raw_fields);
- auto model_emf_uri = lttng::make_unique_wrapper<char, lttng::free>(raw_model_emf_uri);
+ auto signature = lttng::make_unique_wrapper<char, lttng::memory::free>(raw_signature);
+ auto fields =
+ lttng::make_unique_wrapper<lttng_ust_ctl_field, lttng::memory::free>(raw_fields);
+ auto model_emf_uri =
+ lttng::make_unique_wrapper<char, lttng::memory::free>(raw_model_emf_uri);
/* Lookup application. If not found, there is a code flow error. */
app = find_app_by_notify_sock(sock);
struct ust_app_session *ua_sess;
uint64_t enum_id = -1ULL;
lttng::urcu::read_lock_guard read_lock_guard;
- auto entries = lttng::make_unique_wrapper<struct lttng_ust_ctl_enum_entry, lttng::free>(
- raw_entries);
+ auto entries =
+ lttng::make_unique_wrapper<struct lttng_ust_ctl_enum_entry, lttng::memory::free>(
+ raw_entries);
/* Lookup application. If not found, there is a code flow error. */
app = find_app_by_notify_sock(sock);
struct cds_lfht_node *nodep;
lsu::registry_enum *reg_enum = nullptr, *old_reg_enum;
lttng::urcu::read_lock_guard read_lock_guard;
- auto entries =
- lttng::make_unique_wrapper<lttng_ust_ctl_enum_entry, lttng::free>(raw_entries);
+ auto entries = lttng::make_unique_wrapper<lttng_ust_ctl_enum_entry, lttng::memory::free>(
+ raw_entries);
LTTNG_ASSERT(enum_name);
} while (ret != 0);
}
- std::unique_ptr<char, lttng::memory::create_deleter_class<char, lttng::free>::deleter>
+ std::unique_ptr<char,
+ lttng::memory::create_deleter_class<char, lttng::memory::free>::deleter>
stats_str;
if (!session_was_already_stopped) {
char *raw_stats_str = nullptr;
* destroy the file.
*/
const auto session_name =
- lttng::make_unique_wrapper<char, lttng::free>(get_session_name_quiet());
+ lttng::make_unique_wrapper<char, lttng::memory::free>(get_session_name_quiet());
if (session_name && !strncmp(session.name, session_name.get(), NAME_MAX)) {
config_destroy_default();
}
lttng_dynamic_pointer_array_get_count(&exclusions),
(char **) exclusions.array.buffer.data);
- auto exclusion_string = lttng::make_unique_wrapper<char, lttng::free>(
- print_exclusions(&exclusions));
+ auto exclusion_string =
+ lttng::make_unique_wrapper<char, lttng::memory::free>(
+ print_exclusions(&exclusions));
if (!exclusion_string) {
PERROR("Cannot allocate exclusion_string");
error = 1;
lttng_dynamic_pointer_array_get_count(&exclusions),
(char **) exclusions.array.buffer.data);
- auto exclusion_string = lttng::make_unique_wrapper<char, lttng::free>(
- print_exclusions(&exclusions));
+ auto exclusion_string =
+ lttng::make_unique_wrapper<char, lttng::memory::free>(
+ print_exclusions(&exclusions));
if (!exclusion_string) {
PERROR("Failed allocate exclusion string");
error = 1;
if (!opt_session_name) {
const auto rc_file_session_name =
- lttng::make_unique_wrapper<char, lttng::free>(get_session_name());
+ lttng::make_unique_wrapper<char, lttng::memory::free>(get_session_name());
if (!rc_file_session_name) {
return CMD_ERROR;
case lttng::cli::session_spec::type::NAME:
if (spec.value == nullptr) {
const auto configured_name =
- lttng::make_unique_wrapper<char, lttng::free>(get_session_name());
+ lttng::make_unique_wrapper<char, lttng::memory::free>(
+ get_session_name());
if (configured_name) {
const struct lttng::cli::session_spec new_spec(
int status;
/*
* The documentation of __cxa_demangle mentions the returned string is allocated
- * using malloc (not new), hence the use of lttng::free.
+ * using malloc (not new), hence the use of lttng::memory::free.
*/
- const auto demangled_name = lttng::make_unique_wrapper<char, lttng::free>(
+ const auto demangled_name = lttng::make_unique_wrapper<char, lttng::memory::free>(
abi::__cxa_demangle(type_info.name(), nullptr, nullptr, &status));
auto it = status == 0 ? formatter<std::string>::format(demangled_name.get(), ctx) :
return std::unique_ptr<WrappedType, deleter>(instance);
}
};
-} /* namespace memory */
/*
* 'free' is a utility function for use with make_unique_wrapper. It makes it easier to
{
std::free(ptr);
}
+} /* namespace memory */
template <typename WrappedType, void (*DeleterFunc)(WrappedType *)>
std::unique_ptr<WrappedType,
const auto ask_ret = lttng_ctl_ask_sessiond(&lsm, (void **) &raw_tracer_status);
const auto tracer_status =
- lttng::make_unique_wrapper<uint32_t, lttng::free>(raw_tracer_status);
+ lttng::make_unique_wrapper<uint32_t, lttng::memory::free>(raw_tracer_status);
if (ask_ret != 4) {
return LTTNG_ERR_INVALID;