From e8cab48db1cdd5a4383e295c10af2cc34e38acc4 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Tue, 17 Mar 2026 22:45:05 -0400 Subject: [PATCH 1/2] xo-alloc2: tidy: delete dup .cpp --- xo-alloc2/src/gc/IGCObject_Any.cpp | 48 ------------------------------ 1 file changed, 48 deletions(-) delete mode 100644 xo-alloc2/src/gc/IGCObject_Any.cpp diff --git a/xo-alloc2/src/gc/IGCObject_Any.cpp b/xo-alloc2/src/gc/IGCObject_Any.cpp deleted file mode 100644 index 95c8cc84..00000000 --- a/xo-alloc2/src/gc/IGCObject_Any.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/** @file IGCObject_Any.cpp - * - **/ - -#include "detail/IGCObject_Any.hpp" -#include -#include - -namespace xo { -namespace mm { - -using xo::facet::DVariantPlaceholder; -using xo::facet::typeseq; -using xo::facet::valid_facet_implementation; - -void -IGCObject_Any::_fatal() -{ - /* control here on uninitialized IAllocator_Any. - * Initialized instance will have specific implementation type - */ - std::cerr << "fatal" - << ": attempt to call uninitialized" - << " IGCObject_Any method" - << std::endl; - std::terminate(); -} - -typeseq -IGCObject_Any::s_typeseq = typeseq::id(); - -bool -IGCObject_Any::_valid - = valid_facet_implementation(); - -// nonconst methods - -auto -IGCObject_Any::forward_children(Opaque, obj) const noexcept -> size_type -{ - _fatal(); -} - - -} /*namespace mm*/ -} /*namespace xo*/ - -/* end IGCObject_Any.cpp */ From 4c59b3244437fbbfbb23b63c3795553c29a9acda Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 18 Mar 2026 09:50:01 -0400 Subject: [PATCH 2/2] xo-gc: + MutationLogEntry.hpp [WIP] --- xo-gc/include/xo/gc/MutationLogEntry.hpp | 47 ++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 xo-gc/include/xo/gc/MutationLogEntry.hpp diff --git a/xo-gc/include/xo/gc/MutationLogEntry.hpp b/xo-gc/include/xo/gc/MutationLogEntry.hpp new file mode 100644 index 00000000..01c36660 --- /dev/null +++ b/xo-gc/include/xo/gc/MutationLogEntry.hpp @@ -0,0 +1,47 @@ +/** @file MutationLogEntry.hpp + * + * @author Roland Conybeare, Mar 2026 + **/ + +#pragma once + +#include "GCObject.hpp" + +namespace xo { + namespace mm { + + /** @brief Track a cross-generational pointer + * + * GC must update pointer when collecting space that target occupies + * + * Design notes: + * - parent must be located at the beginning of an allocation, + * (so that it's immediately preceded by allocation header) + * - destination can be something like + * obj + * but also something else such as + * {obj, obj, ..} + * - for collector need to traverse data pointer *data + **/ + class MutationLogEntry { + public: + MutationLogEntry(void * parent, void ** p_data, obj snap); + + private: + /** address of object containing logged mutation **/ + void * parent_ = nullptr; + /** address of target member of object at address @ref parent_, + * driving this log entry. + **/ + void ** p_data_ = nullptr; + /** AGCObject i/face pointer, asof assignment responsible for this log entry. + * If *p_data_ matches snap_.data(), then AGCObject interface is snap_.iface(). + * Otherwise log entry has been superseded by another assignment. + **/ + obj snap_; + }; + + } /*namespace mm*/ +} /*namespace xo*/ + +/* end MutationLogEntry.hpp */