From 5558e28d15c6f95b44ba3ccd8e3d567ad18cf73d Mon Sep 17 00:00:00 2001 From: harrand Date: Fri, 22 Mar 2024 21:54:02 +0000 Subject: [PATCH 1/2] [messaging] remove concept requirement for emplace_back as it was causing an annoying clang compiler crash. i dont highly value the concept anyway. --- src/tz/core/data/free_list.hpp | 3 +-- src/tz/core/data/free_list.inl | 4 +--- src/tz/core/messaging.inl | 1 + 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/tz/core/data/free_list.hpp b/src/tz/core/data/free_list.hpp index ac60c20324..e71e4661c0 100644 --- a/src/tz/core/data/free_list.hpp +++ b/src/tz/core/data/free_list.hpp @@ -176,8 +176,7 @@ namespace tz * θ(1) */ template - handle emplace_back(Ts&&... ts) requires - requires(C con) {{con.emplace_back(std::forward(ts)...)} -> std::same_as;}; + handle emplace_back(Ts&&... ts); /** * Erase an existing element from the list using its handle. diff --git a/src/tz/core/data/free_list.inl b/src/tz/core/data/free_list.inl index 8315e22bec..24fd1b8ac9 100644 --- a/src/tz/core/data/free_list.inl +++ b/src/tz/core/data/free_list.inl @@ -154,9 +154,7 @@ namespace tz template template - free_list::handle free_list::emplace_back(Ts&&... ts) requires - requires(C con) {{con.emplace_back(std::forward(ts)...)} -> std::same_as;} - // implementation note: i dont think the `requires` clause needs to be here. i am only re-defining it coz of a clang bug. https://github.com/llvm/llvm-project/issues/56482 + free_list::handle free_list::emplace_back(Ts&&... ts) { handle ret; if(this->frees.size()) diff --git a/src/tz/core/messaging.inl b/src/tz/core/messaging.inl index 0fc3c842ef..413ec6878d 100644 --- a/src/tz/core/messaging.inl +++ b/src/tz/core/messaging.inl @@ -1,3 +1,4 @@ +#include "tz/core/debug.hpp" namespace tz { template From 7e7e37bc4b76a8a981f8d31fd6f5e5529a47f231 Mon Sep 17 00:00:00 2001 From: harrand Date: Sat, 23 Mar 2024 00:12:42 +0000 Subject: [PATCH 2/2] [data_store] datastore remove no longer asserts on the thing already existing. its silly and makes the api pointlessly aggressive --- src/tz/core/data/data_store.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tz/core/data/data_store.cpp b/src/tz/core/data/data_store.cpp index 42a1161d9c..84e59eed2d 100644 --- a/src/tz/core/data/data_store.cpp +++ b/src/tz/core/data/data_store.cpp @@ -37,7 +37,7 @@ namespace tz { TZ_PROFZONE("data_store - remove", 0xFF3377AA); std::unique_lock ulock(this->mtx); - tz::assert(this->contains_nolock(remove.key), "remove called on %s, which does not exist in the datastore", remove.key.data()); + //tz::assert(this->contains_nolock(remove.key), "remove called on %s, which does not exist in the datastore", remove.key.data()); this->store.erase(remove.key); }