diff --git a/ircd/client.cc b/ircd/client.cc index 1454a972f..27b198b97 100644 --- a/ircd/client.cc +++ b/ircd/client.cc @@ -95,6 +95,7 @@ ircd::client::pool_opts /// The pool of request contexts. When a client makes a request it does so by acquiring /// a stack from this pool. The request handling and response logic can then be written /// in a synchronous manner as if each connection had its own thread. +[[clang::always_destroy]] decltype(ircd::client::pool) ircd::client::pool { diff --git a/ircd/ctx.cc b/ircd/ctx.cc index b087815a6..c7a1e220d 100644 --- a/ircd/ctx.cc +++ b/ircd/ctx.cc @@ -50,6 +50,7 @@ ircd::ctx::ctx::id_ctr /// execution slice in the ircd::ios handler list. This posits the entire /// ircd::ctx system as one ircd::ios handler type among all the others. /// At this time it is unclear how to hook a context's execution slice in the ircd::ios system. +[[clang::always_destroy]] decltype(ircd::ctx::ctx::ios_desc) ircd::ctx::ctx::ios_desc { @@ -543,6 +544,7 @@ namespace ircd::ctx extern ios::descriptor signal_desc; } +[[clang::always_destroy]] decltype(ircd::ctx::signal_desc) ircd::ctx::signal_desc { @@ -740,6 +742,7 @@ noexcept // ctx/this_ctx.h // +[[clang::always_destroy]] decltype(ircd::ctx::this_ctx::courtesy_yield_desc) ircd::ctx::this_ctx::courtesy_yield_desc { @@ -1152,6 +1155,7 @@ namespace ircd::ctx extern ios::descriptor spawn_desc[3]; } +[[clang::always_destroy]] decltype(ircd::ctx::spawn_desc) ircd::ctx::spawn_desc { diff --git a/ircd/ctx_ole.cc b/ircd/ctx_ole.cc index 1b1a590a0..da19f3bf8 100644 --- a/ircd/ctx_ole.cc +++ b/ircd/ctx_ole.cc @@ -16,9 +16,9 @@ namespace ircd::ctx::ole static std::mutex mutex; static std::condition_variable cond; - static std::deque queue; + extern std::deque queue; static ssize_t working; - static std::vector threads; + extern std::vector threads; static bool termination alignas(64); static offload::function pop(); @@ -34,6 +34,14 @@ ircd::ctx::ole::thread_max { "default", int64_t(1) }, }; +[[gnu::visibility("internal"), clang::always_destroy]] +decltype(ircd::ctx::ole::queue) +ircd::ctx::ole::queue; + +[[gnu::visibility("internal"), clang::always_destroy]] +decltype(ircd::ctx::ole::threads) +ircd::ctx::ole::threads; + ircd::ctx::ole::init::init() { assert(threads.empty()); diff --git a/ircd/db.cc b/ircd/db.cc index b82da0387..98ff6f15b 100644 --- a/ircd/db.cc +++ b/ircd/db.cc @@ -95,6 +95,7 @@ ircd::db::request_pool_opts /// The number of workers in this pool should upper bound at the /// number of concurrent AIO requests which are effective on this /// system. This is a static pool shared by all databases. +[[clang::always_destroy]] decltype(ircd::db::request) ircd::db::request { @@ -281,6 +282,7 @@ catch(const std::exception &e) }; } +[[clang::always_destroy]] decltype(ircd::db::compressions) ircd::db::compressions; diff --git a/ircd/fmt.cc b/ircd/fmt.cc index d89b77828..a89d282be 100644 --- a/ircd/fmt.cc +++ b/ircd/fmt.cc @@ -130,6 +130,7 @@ ircd::fmt::specifier static const specifier &at(const string_view &name); }; +[[clang::always_destroy]] decltype(ircd::fmt::specifier::registry) ircd::fmt::specifier::registry; diff --git a/ircd/fs_aio.cc b/ircd/fs_aio.cc index df421af30..eb31a3d25 100644 --- a/ircd/fs_aio.cc +++ b/ircd/fs_aio.cc @@ -674,12 +674,14 @@ ircd::fs::aio::system::eventfd_flags EFD_CLOEXEC | EFD_NONBLOCK }; +[[clang::always_destroy]] decltype(ircd::fs::aio::system::chase_descriptor) ircd::fs::aio::system::chase_descriptor { "ircd.fs.aio.chase" }; +[[clang::always_destroy]] decltype(ircd::fs::aio::system::handle_descriptor) ircd::fs::aio::system::handle_descriptor { diff --git a/ircd/fs_iou.cc b/ircd/fs_iou.cc index 7fc5e22f9..17d7a8545 100644 --- a/ircd/fs_iou.cc +++ b/ircd/fs_iou.cc @@ -512,6 +512,7 @@ catch(...) throw; } +[[clang::always_destroy]] decltype(ircd::fs::iou::system::handle_descriptor) ircd::fs::iou::system::handle_descriptor { diff --git a/ircd/logger.cc b/ircd/logger.cc index b0d97bb66..a8e973e20 100644 --- a/ircd/logger.cc +++ b/ircd/logger.cc @@ -63,6 +63,7 @@ ircd::instance_list::list allocator }; +[[clang::always_destroy]] decltype(ircd::log::file) ircd::log::file; @@ -845,6 +846,7 @@ ircd::log::is_conf_mask_file(const string_view &name) return empty(string_view(mask_file)); } +[[clang::always_destroy]] decltype(ircd::log::unmask_file) ircd::log::unmask_file { @@ -858,6 +860,7 @@ ircd::log::unmask_file } }; +[[clang::always_destroy]] decltype(ircd::log::unmask_console) ircd::log::unmask_console { @@ -871,6 +874,7 @@ ircd::log::unmask_console } }; +[[clang::always_destroy]] decltype(ircd::log::mask_file) ircd::log::mask_file { @@ -884,6 +888,7 @@ ircd::log::mask_file } }; +[[clang::always_destroy]] decltype(ircd::log::mask_console) ircd::log::mask_console { diff --git a/ircd/mods.cc b/ircd/mods.cc index 0f471e2e7..95e91d273 100644 --- a/ircd/mods.cc +++ b/ircd/mods.cc @@ -1172,9 +1172,9 @@ ircd::mods::suffix boost::dll::shared_library::suffix().string() }; +[[clang::always_destroy]] decltype(ircd::mods::paths) -ircd::mods::paths -{}; +ircd::mods::paths; // // util diff --git a/ircd/net.cc b/ircd/net.cc index f9dc683b2..306b47ddf 100644 --- a/ircd/net.cc +++ b/ircd/net.cc @@ -1194,6 +1194,7 @@ ircd::net::scope_timeout::release() // net/socket.h // +[[clang::always_destroy]] decltype(ircd::net::ssl_curve_list) ircd::net::ssl_curve_list { @@ -1201,6 +1202,7 @@ ircd::net::ssl_curve_list { "default", string_view{} }, }; +[[clang::always_destroy]] decltype(ircd::net::ssl_cipher_list) ircd::net::ssl_cipher_list { @@ -1208,6 +1210,7 @@ ircd::net::ssl_cipher_list { "default", string_view{} }, }; +[[clang::always_destroy]] decltype(ircd::net::ssl_cipher_blacklist) ircd::net::ssl_cipher_blacklist { @@ -1215,6 +1218,7 @@ ircd::net::ssl_cipher_blacklist { "default", string_view{} }, }; +[[clang::always_destroy]] [[gnu::visibility("hidden")]] boost::asio::ssl::context ircd::net::sslv23_client @@ -1228,30 +1232,35 @@ ircd::net::socket::count; decltype(ircd::net::socket::instances) ircd::net::socket::instances; +[[clang::always_destroy]] decltype(ircd::net::socket::desc_connect) ircd::net::socket::desc_connect { "ircd.net.socket.connect" }; +[[clang::always_destroy]] decltype(ircd::net::socket::desc_handshake) ircd::net::socket::desc_handshake { "ircd.net.socket.handshake" }; +[[clang::always_destroy]] decltype(ircd::net::socket::desc_disconnect) ircd::net::socket::desc_disconnect { "ircd.net.socket.disconnect" }; +[[clang::always_destroy]] decltype(ircd::net::socket::desc_timeout) ircd::net::socket::desc_timeout { "ircd.net.socket.timeout" }; +[[clang::always_destroy]] decltype(ircd::net::socket::desc_wait) ircd::net::socket::desc_wait { diff --git a/ircd/net_listener.cc b/ircd/net_listener.cc index 238686fd5..5b0517bb8 100644 --- a/ircd/net_listener.cc +++ b/ircd/net_listener.cc @@ -226,12 +226,14 @@ ircd::net::acceptor::log "net.listen" }; +[[clang::always_destroy]] decltype(ircd::net::acceptor::accept_desc) ircd::net::acceptor::accept_desc { "ircd.net.acceptor.accept" }; +[[clang::always_destroy]] decltype(ircd::net::acceptor::handshake_desc) ircd::net::acceptor::handshake_desc { diff --git a/ircd/rfc1035.cc b/ircd/rfc1035.cc index e9db8c908..5867dc082 100644 --- a/ircd/rfc1035.cc +++ b/ircd/rfc1035.cc @@ -573,6 +573,7 @@ const return ss.str(); } +[[clang::always_destroy]] decltype(ircd::rfc1035::rcode) ircd::rfc1035::rcode { @@ -603,6 +604,7 @@ ircd::rfc1035::rcode "BADCOOKIE Bad/missing Server Cookie [RFC7873]", // 24 }; +[[clang::always_destroy]] decltype(ircd::rfc1035::qtype) ircd::rfc1035::qtype { @@ -692,6 +694,7 @@ ircd::rfc1035::qtype { "TA", 32768 }, // DNSSEC Trust Authorities [Sam_Weiler][http://cameo.library.cmu.edu/] }; +[[clang::always_destroy]] decltype(ircd::rfc1035::rqtype) ircd::rfc1035::rqtype{[] { diff --git a/ircd/server.cc b/ircd/server.cc index 6613a8b57..cc4c3688b 100644 --- a/ircd/server.cc +++ b/ircd/server.cc @@ -711,6 +711,7 @@ decltype(ircd::server::peer::sock_opts) ircd::server::peer::sock_opts {}; +[[clang::always_destroy]] decltype(ircd::server::peer::close_desc) ircd::server::peer::close_desc { diff --git a/ircd/util.cc b/ircd/util.cc index 25d157f06..ce88b2cd1 100644 --- a/ircd/util.cc +++ b/ircd/util.cc @@ -445,6 +445,7 @@ ircd::util::a2u(const mutable_buffer &out, ircd::util::unwind_defer::~unwind_defer() noexcept { + [[clang::always_destroy]] static ios::descriptor descriptor { "ircd.unwind"