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

@ -4,6 +4,7 @@
**/
#include "AllocIterator.hpp"
#include "GCObject.hpp"
#include "arena/IAllocator_DArena.hpp"
#include "arena/IAllocIterator_DArenaIterator.hpp" // for alloc_range
#include <xo/arena/DArenaIterator.hpp>
@ -154,6 +155,31 @@ namespace xo {
//s.checkpoint_ = s.lo_;
}
void
IAllocator_DArena::barrier_assign_aux(DArena & s,
void * parent,
AGCObject * lhs_iface, void ** lhs_data,
AGCObject * rhs_iface, void * rhs_data)
{
(void)s;
(void)parent;
// usually would expect this to just forward to DArena.
// That's problematic in this case, because DArena is at lower level
// relative to obj<AAllocator,DArena>;
// recall that DArena is used in the implementation of xo-facet/
//
// In any case, for DArena no write barrier is applied.
// Instead just perform the fop assignment
// replacing vtable pointer here
if (lhs_iface) {
::memcpy((void *)lhs_iface, (void *)rhs_iface, sizeof(AGCObject));
}
*lhs_data = rhs_data;
}
void
IAllocator_DArena::destruct_data(DArena & s)
{