diff --git a/CMakeLists.txt b/CMakeLists.txt index 0db9989..a8d5f4a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,7 @@ macro(compile_options target_name) sanitizers(${target_name}) endmacro() -project(blt-gp VERSION 0.4.5) +project(blt-gp VERSION 0.4.6) include(CTest) diff --git a/include/blt/gp/operations.h b/include/blt/gp/operations.h index c7f3d86..1fe2e69 100644 --- a/include/blt/gp/operations.h +++ b/include/blt/gp/operations.h @@ -63,9 +63,10 @@ namespace blt::gp template static void call_drop(stack_allocator& read_allocator, const size_t offset) { - if constexpr (blt::gp::detail::has_func_drop_v) + if constexpr (blt::gp::detail::has_func_drop_v>) { auto [type, ptr] = read_allocator.access_pointer>(offset); + // type is not ephemeral, so we must drop it. if (!ptr.bit(0)) type.drop(); } @@ -200,7 +201,7 @@ namespace blt::gp [[nodiscard]] bool return_has_ephemeral_drop() const { - return detail::has_func_drop_v; + return detail::has_func_drop_v>; } operator_id id = -1; diff --git a/include/blt/gp/stack.h b/include/blt/gp/stack.h index 5e0d6cb..a83457c 100644 --- a/include/blt/gp/stack.h +++ b/include/blt/gp/stack.h @@ -21,21 +21,16 @@ #include #include -#include #include #include -#include #include -#include -#include +#include #include #include -#include #include #include #include #include -#include namespace blt::gp { @@ -87,7 +82,7 @@ namespace blt::gp static constexpr size_t aligned_size() noexcept { const auto bytes = detail::aligned_size(sizeof(NO_REF_T)); - if constexpr (blt::gp::detail::has_func_drop_v) + if constexpr (blt::gp::detail::has_func_drop_v>) return bytes + detail::aligned_size(sizeof(std::atomic_uint64_t*)); return bytes; } @@ -179,7 +174,7 @@ namespace blt::gp const auto ptr = static_cast(allocate_bytes_for_size(aligned_size())); std::memcpy(ptr, &t, sizeof(NO_REF)); - if constexpr (gp::detail::has_func_drop_v) + if constexpr (gp::detail::has_func_drop_v>) { new(ptr + sizeof(NO_REF)) mem::pointer_storage{nullptr}; } diff --git a/include/blt/gp/tree.h b/include/blt/gp/tree.h index 2d10a1e..18e75be 100644 --- a/include/blt/gp/tree.h +++ b/include/blt/gp/tree.h @@ -166,7 +166,7 @@ namespace blt::gp ~evaluation_ref() { - if constexpr (detail::has_func_drop_v) + if constexpr (detail::has_func_drop_v>) { if (m_value.get() != nullptr) { diff --git a/include/blt/gp/typesystem.h b/include/blt/gp/typesystem.h index 517d8cd..b74edda 100644 --- a/include/blt/gp/typesystem.h +++ b/include/blt/gp/typesystem.h @@ -48,7 +48,7 @@ namespace blt::gp template static type make_type(const type_id id) { - return type(stack_allocator::aligned_size(), id, blt::type_string(), detail::has_func_drop_v); + return type(stack_allocator::aligned_size(), id, blt::type_string(), detail::has_func_drop_v>); } [[nodiscard]] size_t size() const diff --git a/lib/blt b/lib/blt index 284743c..9a05c86 160000 --- a/lib/blt +++ b/lib/blt @@ -1 +1 @@ -Subproject commit 284743c683aebae3277f64a07cdd0deedf629039 +Subproject commit 9a05c86b02c9c45c2b384c531007416148ec4b56