refactor focusing on xo-alloc2/ xo-gc/ write-barrier

ability to inform allocator of gco->gco mutation, via AAllocator i/face.
This commit is contained in:
Roland Conybeare 2026-05-01 19:54:26 -04:00
commit b780d1da4c
17 changed files with 149 additions and 18 deletions

View file

@ -14,7 +14,7 @@
#pragma once
// includes (via {facet_includes})
#include <xo/alloc2/Allocator.hpp>
#include <xo/alloc2/Allocator_basic.hpp>
#include <xo/alloc2/Generation.hpp>
#include <xo/alloc2/role.hpp>
#include <xo/facet/obj.hpp>

View file

@ -14,7 +14,7 @@
#pragma once
// includes (via {facet_includes})
#include <xo/alloc2/Allocator.hpp>
#include <xo/alloc2/Allocator_basic.hpp>
#include <xo/alloc2/Collector.hpp>
#include <xo/alloc2/GCObjectVisitor.hpp>
#include <cstdint>

View file

@ -13,7 +13,7 @@
#pragma once
#include <xo/alloc2/Allocator.hpp>
#include <xo/alloc2/Allocator_basic.hpp>
#include <xo/alloc2/Generation.hpp>
#include <xo/alloc2/role.hpp>

View file

@ -13,7 +13,7 @@
#pragma once
#include <xo/alloc2/Allocator.hpp>
#include <xo/alloc2/Allocator_basic.hpp>
#include <xo/alloc2/Collector.hpp>
#include <xo/alloc2/GCObjectVisitor.hpp>
#include <cstdint>

View file

@ -52,7 +52,7 @@ public:
void * alloc_copy_for(const T * src) noexcept {
return O::iface()->alloc_copy(O::data(), (std::byte *)const_cast<T *>(src));
}
/** convenience template for move-constructible T (this is common) **/
template <typename T>
T * std_move_for(T * src) noexcept {
@ -62,28 +62,28 @@ public:
}
return nullptr;
}
/** forward faceted object pointer in place. Defined in GCObject.hpp to avoid #include cycle **/
template <typename DRepr>
void forward_inplace(obj<AGCObject,DRepr> * p_obj);
/** another convenience template for forwarding.
* Defined in RGCObject.hpp to avoid #include cycle.
**/
template <typename DRepr>
void forward_inplace(DRepr ** pp_repr);
/** convenience template where pointer requires pivot **/
template <typename AFacet, typename DRepr>
requires (!std::is_same_v<AFacet, AGCObject>)
void forward_pivot_inplace(obj<AFacet,DRepr> * p_obj);
/** add root @p p_root **/
template<typename DRepr>
void add_gc_root(obj<AGCObject, DRepr> * p_root) {
O::iface()->add_gc_root_poly(O::data(), (obj<AGCObject> *)p_root);
}
/** remove root @p p_root **/
template <typename DRepr>
void remove_gc_root(obj<AGCObject, DRepr> * p_root) {