From: Jérémie Galarneau Date: Thu, 9 Jun 2022 16:16:39 +0000 (-0400) Subject: sessiond: registry_session: mark functions as noexcept X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=3691d312bcf4dc2cc15f0ecb1f0e2fd2f34315b8;p=lttng-tools.git sessiond: registry_session: mark functions as noexcept Mark functions destroy_channel and _destroy_enum as noexcept as they are used by the registry_session destructor (which must not throw). Signed-off-by: Jérémie Galarneau Change-Id: Ie7bbbf349f14f5691b52873fe8ba6556be143d93 --- diff --git a/src/bin/lttng-sessiond/ust-registry-session.cpp b/src/bin/lttng-sessiond/ust-registry-session.cpp index 255a5ec81..b78091a04 100644 --- a/src/bin/lttng-sessiond/ust-registry-session.cpp +++ b/src/bin/lttng-sessiond/ust-registry-session.cpp @@ -98,8 +98,10 @@ void destroy_channel_rcu(struct rcu_head *head) * Destroy every element of the registry and free the memory. This does NOT * free the registry pointer since it might not have been allocated before so * it's the caller responsability. + * + * Called from ~registry_session(), must not throw. */ -void destroy_channel(lsu::registry_channel *chan, bool notify) +void destroy_channel(lsu::registry_channel *chan, bool notify) noexcept { struct lttng_ht_iter iter; lttng::sessiond::ust::registry_event *event; @@ -286,8 +288,10 @@ lsu::registry_session::registry_session(const struct lst::abi& in_abi, /* * For a given enumeration in a registry, delete the entry and destroy * the enumeration. + * + * Note that this is used by ~registry_session() and must not throw. */ -void lsu::registry_session::_destroy_enum(lsu::registry_enum *reg_enum) +void lsu::registry_session::_destroy_enum(lsu::registry_enum *reg_enum) noexcept { int ret; lttng::urcu::read_lock_guard read_lock_guard; diff --git a/src/bin/lttng-sessiond/ust-registry-session.hpp b/src/bin/lttng-sessiond/ust-registry-session.hpp index 0bd023d70..cce7c5c1b 100644 --- a/src/bin/lttng-sessiond/ust-registry-session.hpp +++ b/src/bin/lttng-sessiond/ust-registry-session.hpp @@ -112,7 +112,7 @@ private: void _increase_metadata_size(size_t reservation_length); void _append_metadata_fragment(const std::string& fragment); void _reset_metadata(); - void _destroy_enum(registry_enum *reg_enum); + void _destroy_enum(registry_enum *reg_enum) noexcept; registry_enum *_lookup_enum(const registry_enum *target_enum) const; virtual void _accept_on_clock_classes(