diff --git a/include/xo/alloc2/alloc/AAllocator.hpp b/include/xo/alloc2/alloc/AAllocator.hpp index 9d0966c..7a940be 100644 --- a/include/xo/alloc2/alloc/AAllocator.hpp +++ b/include/xo/alloc2/alloc/AAllocator.hpp @@ -159,11 +159,13 @@ namespace xo { * zero @p z. **/ virtual value_type sub_alloc(Opaque d, size_type z, bool complete_flag) const = 0; +#ifdef OBSOLETE /** Allocate copy of an existing object @p src. * Existing object must be contained in @p d. * NOTE: load bearing for copying garbage collector. **/ virtual value_type alloc_copy(Opaque d, value_type src) const = 0; +#endif /** reset allocator @p d to empty state. **/ virtual void clear(Opaque d) const = 0; /** assign helper for allocator that may require a write barrier diff --git a/include/xo/alloc2/alloc/IAllocator_Any.hpp b/include/xo/alloc2/alloc/IAllocator_Any.hpp index 0aafca4..06e7e58 100644 --- a/include/xo/alloc2/alloc/IAllocator_Any.hpp +++ b/include/xo/alloc2/alloc/IAllocator_Any.hpp @@ -58,7 +58,9 @@ namespace xo { [[noreturn]] value_type alloc(Opaque, typeseq, std::size_t) const override { _fatal(); } [[noreturn]] value_type super_alloc(Opaque, typeseq, std::size_t) const override { _fatal(); } [[noreturn]] value_type sub_alloc(Opaque, std::size_t, bool) const override { _fatal(); } +#ifdef OBSOLETE [[noreturn]] value_type alloc_copy(Opaque, value_type) const override { _fatal(); } +#endif [[noreturn]] void clear(Opaque) const override { _fatal(); } [[noreturn]] void barrier_assign_aux(Opaque, void *, diff --git a/include/xo/alloc2/alloc/IAllocator_Xfer.hpp b/include/xo/alloc2/alloc/IAllocator_Xfer.hpp index 3343559..d2cd950 100644 --- a/include/xo/alloc2/alloc/IAllocator_Xfer.hpp +++ b/include/xo/alloc2/alloc/IAllocator_Xfer.hpp @@ -75,8 +75,10 @@ namespace xo { bool complete_flag) const override { return I::sub_alloc(_dcast(d), z, complete_flag); } +#ifdef OBSOLETE value_type alloc_copy(Opaque d, value_type src) const override { return I::alloc_copy(_dcast(d), src); } +#endif void clear(Opaque d) const override { return I::clear(_dcast(d)); } void barrier_assign_aux(Opaque d, void * parent, diff --git a/utest/CMakeLists.txt b/utest/CMakeLists.txt index 3382224..9f9ece5 100644 --- a/utest/CMakeLists.txt +++ b/utest/CMakeLists.txt @@ -10,6 +10,7 @@ set(UTEST_SRCS # Collector.test.cpp # DX1CollectorIterator.test.cpp Generation.test.cpp + VisitReason.test.cpp dp.test.cpp random_allocs.cpp ) diff --git a/utest/VisitReason.test.cpp b/utest/VisitReason.test.cpp new file mode 100644 index 0000000..ceef9a0 --- /dev/null +++ b/utest/VisitReason.test.cpp @@ -0,0 +1,26 @@ +/** @file VisitReason.test.cpp + * + * @author Roland Conybeare, May 2026 + **/ + +#include +#include + +namespace xo { + using xo::mm::VisitReason; + + namespace ut { + + TEST_CASE("visitreason-1", "[visitreason]") + { + REQUIRE(VisitReason::unspecified() == VisitReason::unspecified()); + + REQUIRE(VisitReason::unspecified() != VisitReason::forward()); + REQUIRE(VisitReason::unspecified() != VisitReason::verify()); + REQUIRE(VisitReason::forward() != VisitReason::verify()); + } + + } /*namespace ut*/ +} /*namespace xo*/ + +/* end VisitReason.test.cpp */