From 5d83363a6996142904ba6b46758c054c3b036a72 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Tue, 6 Jan 2026 00:01:38 -0500 Subject: [PATCH] xo-arena xo-facet xo-alloc2: build restored --- cmake/xo_alloc2Config.cmake.in | 1 + include/xo/alloc2/AllocError.hpp | 79 ------------------- include/xo/alloc2/alloc/AAllocIterator.hpp | 2 +- include/xo/alloc2/alloc/AAllocator.hpp | 2 +- .../xo/alloc2/alloc/IAllocIterator_Any.hpp | 2 +- .../xo/alloc2/alloc/IAllocIterator_Xfer.hpp | 6 +- include/xo/alloc2/alloc/RAllocIterator.hpp | 2 +- src/alloc2/AllocError.cpp | 45 ----------- src/alloc2/CMakeLists.txt | 3 +- src/alloc2/IAllocIterator_Any.cpp | 2 +- 10 files changed, 11 insertions(+), 133 deletions(-) delete mode 100644 include/xo/alloc2/AllocError.hpp delete mode 100644 src/alloc2/AllocError.cpp diff --git a/cmake/xo_alloc2Config.cmake.in b/cmake/xo_alloc2Config.cmake.in index 65ab5b1..e0b5e0b 100644 --- a/cmake/xo_alloc2Config.cmake.in +++ b/cmake/xo_alloc2Config.cmake.in @@ -2,6 +2,7 @@ include(CMakeFindDependencyMacro) #find_dependency(indentlog) +find_depnedency(xo_arena) find_dependency(xo_facet) include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") check_required_components("@PROJECT_NAME@") diff --git a/include/xo/alloc2/AllocError.hpp b/include/xo/alloc2/AllocError.hpp deleted file mode 100644 index ca98b36..0000000 --- a/include/xo/alloc2/AllocError.hpp +++ /dev/null @@ -1,79 +0,0 @@ -/** @file AllocError.hpp - * - * @author Roland Conybeare, Dec 2025 - **/ - -#pragma once - -#include -#include - -namespace xo { - namespace mm { - enum class error : int32_t { - /** sentinel **/ - invalid = -1, - /** not an error **/ - ok, - /** reserved size exhauged **/ - reserve_exhausted, - /** unable to commit (i.e. mprotect failure) **/ - commit_failed, - /** allocation size too big (See @ref ArenaConfig::header_size_mask_) **/ - header_size_mask, - /** sub_alloc not preceded by super alloc (or another sub_alloc) **/ - orphan_sub_alloc, - /** attempt to call alloc_info for allocator with alloc header feature disabled - * (e.g. @ref see ArenaConfig::store_header_flag_) - **/ - alloc_info_disabled, - /** attempt to call alloc_info for address not owned by allocator **/ - alloc_info_address, - /** for example: alloc iteration not supported in arenas with - * AllocConfig.store_header_flag_ = false - **/ - alloc_iterator_not_supported, - /** attempt to deref an iterator that does not refer to an alloc **/ - alloc_iterator_deref, - /** attempt to advance an iterator that does not refer to an alloc **/ - alloc_iterator_next, - }; - - struct AllocError { - using size_type = std::size_t; - using value_type = std::byte*; - - AllocError() = default; - explicit AllocError(error err, - uint32_t seq) : error_{err}, - error_seq_{seq} {} - AllocError(error err, - uint32_t seq, - size_type req_z, - size_type com_z, - size_type rsv_z) : error_{err}, - error_seq_{seq}, - request_z_{req_z}, - committed_z_{com_z}, - reserved_z_{rsv_z} {} - - static const char * error_description(error x); - - /** error code **/ - error error_ = error::ok; - - /** sequence# of this error. - * Each error event within an allocator gets next sequence number - **/ - uint32_t error_seq_ = 0; - /** reqeust size assoc'd with errror **/ - size_type request_z_ = 0; - /** committed allocator memory at time of error **/ - size_type committed_z_ = 0; - /** reserved allocator memory at time of error **/ - size_type reserved_z_ = 0; - }; - } /*namespace mm*/ -} /*namespace xo*/ - -/* end AllocError.hpp */ diff --git a/include/xo/alloc2/alloc/AAllocIterator.hpp b/include/xo/alloc2/alloc/AAllocIterator.hpp index 4b9f4ab..e7581dc 100644 --- a/include/xo/alloc2/alloc/AAllocIterator.hpp +++ b/include/xo/alloc2/alloc/AAllocIterator.hpp @@ -23,7 +23,7 @@ namespace xo { **/ struct AAllocIterator { using obj_AAllocIterator = xo::facet::obj; - using typeseq = xo::facet::typeseq; + using typeseq = xo::reflect::typeseq; /** @defgroup mm-allociterator-methods AllocIterator methods **/ ///@{ diff --git a/include/xo/alloc2/alloc/AAllocator.hpp b/include/xo/alloc2/alloc/AAllocator.hpp index 0fce475..588b439 100644 --- a/include/xo/alloc2/alloc/AAllocator.hpp +++ b/include/xo/alloc2/alloc/AAllocator.hpp @@ -5,7 +5,7 @@ #pragma once -#include "AllocError.hpp" +#include #include "AllocInfo.hpp" //#include "AllocIterator.hpp" #include "AllocRange.hpp" diff --git a/include/xo/alloc2/alloc/IAllocIterator_Any.hpp b/include/xo/alloc2/alloc/IAllocIterator_Any.hpp index f946c39..1bed0ff 100644 --- a/include/xo/alloc2/alloc/IAllocIterator_Any.hpp +++ b/include/xo/alloc2/alloc/IAllocIterator_Any.hpp @@ -20,7 +20,7 @@ namespace xo { * @brief AllocIterator implementation for empty variant instance **/ struct IAllocIterator_Any : public AAllocIterator { - using typeseq = xo::facet::typeseq; + using typeseq = xo::reflect::typeseq; const AAllocIterator * iface() const { return std::launder(this); } diff --git a/include/xo/alloc2/alloc/IAllocIterator_Xfer.hpp b/include/xo/alloc2/alloc/IAllocIterator_Xfer.hpp index e61e326..251f4af 100644 --- a/include/xo/alloc2/alloc/IAllocIterator_Xfer.hpp +++ b/include/xo/alloc2/alloc/IAllocIterator_Xfer.hpp @@ -18,7 +18,7 @@ namespace xo { typename IAllocIterator_DRepr> struct IAllocIterator_Xfer : public AAllocIterator { using Impl = IAllocIterator_DRepr; - using typeseq = xo::facet::typeseq; + using typeseq = xo::reflect::typeseq; static const DRepr & _dcast(Copaque d) { return *(const DRepr *)d; } static DRepr & _dcast(Opaque d) { return *(DRepr *)d; } @@ -48,9 +48,9 @@ namespace xo { }; template - xo::facet::typeseq + xo::reflect::typeseq IAllocIterator_Xfer::s_typeseq - = facet::typeseq::id(); + = reflect::typeseq::id(); template bool diff --git a/include/xo/alloc2/alloc/RAllocIterator.hpp b/include/xo/alloc2/alloc/RAllocIterator.hpp index 4e1a95f..47d59f2 100644 --- a/include/xo/alloc2/alloc/RAllocIterator.hpp +++ b/include/xo/alloc2/alloc/RAllocIterator.hpp @@ -17,7 +17,7 @@ namespace xo { public: using ObjectType = Object; using DataPtr = Object::DataPtr; - using typeseq = xo::facet::typeseq; + using typeseq = xo::reflect::typeseq; RAllocIterator() {} RAllocIterator(Object::DataPtr data) : Object{std::move(data)} {} diff --git a/src/alloc2/AllocError.cpp b/src/alloc2/AllocError.cpp deleted file mode 100644 index 43c1678..0000000 --- a/src/alloc2/AllocError.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/** @file AllocError.cpp - * - * @author Roland Conybeare, Dec 2025 - **/ - -#include "AllocError.hpp" - -namespace xo { - namespace mm { - - const char * - AllocError::error_description(error x) - { - switch (x) { - case error::invalid: - break; - case error::ok: - return "ok"; - case error::reserve_exhausted: - return "reserve-exhausted"; - case error::commit_failed: - return "commit-failed"; - case error::header_size_mask: - return "header-size-mask"; - case error::orphan_sub_alloc: - return "orphan-sub-alloc"; - case error::alloc_info_disabled: - return "alloc-info-disabled"; - case error::alloc_info_address: - return "alloc-info-address"; - case error::alloc_iterator_not_supported: - return "alloc-iterator-not-supported"; - case error::alloc_iterator_deref: - return "alloc-iterator-deref"; - case error::alloc_iterator_next: - return "alloc-iterator-next"; - } - - return "?error"; - } - - } /*namespace mm*/ -} /*namespace xo*/ - -/* end AllocError.cpp */ diff --git a/src/alloc2/CMakeLists.txt b/src/alloc2/CMakeLists.txt index 1d66ead..a93f7db 100644 --- a/src/alloc2/CMakeLists.txt +++ b/src/alloc2/CMakeLists.txt @@ -3,7 +3,7 @@ set(SELF_LIB xo_alloc2) set(SELF_SRCS - AllocError.cpp +# AllocError.cpp AllocInfo.cpp cmpresult.cpp @@ -21,5 +21,6 @@ set(SELF_SRCS xo_add_shared_library4(${SELF_LIB} ${PROJECT_NAME}Targets ${PROJECT_VERSION} 1 ${SELF_SRCS}) # note: deps here must also appear in cmake/xo_alloc2Config.cmake.in +xo_dependency(${SELF_LIB} xo_arena) xo_dependency(${SELF_LIB} xo_facet) xo_dependency(${SELF_LIB} indentlog) diff --git a/src/alloc2/IAllocIterator_Any.cpp b/src/alloc2/IAllocIterator_Any.cpp index befaea8..86c2ba7 100644 --- a/src/alloc2/IAllocIterator_Any.cpp +++ b/src/alloc2/IAllocIterator_Any.cpp @@ -9,8 +9,8 @@ namespace xo { namespace mm { using xo::facet::DVariantPlaceholder; - using xo::facet::typeseq; using xo::facet::valid_facet_implementation; + using xo::reflect::typeseq; void IAllocIterator_Any::_fatal() {