xo-gc: copy/move step for collection phase

This commit is contained in:
Roland Conybeare 2026-01-04 00:34:19 -05:00
commit 65ee116ff8
4 changed files with 6 additions and 9 deletions

View file

@ -25,8 +25,7 @@ namespace xo {
IGCObject_DFloat::shallow_copy(const DFloat & src,
obj<AAllocator> mm) noexcept
{
DFloat * copy = (DFloat *)mm.alloc(typeseq::id<DFloat>(),
sizeof(DFloat));
DFloat * copy = (DFloat *)mm.alloc_copy((std::byte *)&src);
if (copy)
*copy = src;

View file

@ -23,10 +23,9 @@ namespace xo {
DInteger *
IGCObject_DInteger::shallow_copy(const DInteger & src,
obj<AAllocator> mm) noexcept
obj<AAllocator> mm) noexcept
{
DInteger * copy = (DInteger *)mm.alloc(typeseq::id<DInteger>(),
sizeof(DInteger));
DInteger * copy = (DInteger *)mm.alloc_copy((std::byte *)&src);
if (copy)
*copy = src;

View file

@ -24,8 +24,7 @@ namespace xo {
IGCObject_DList::shallow_copy(const DList & src,
obj<AAllocator> mm) noexcept
{
/* FIXME: need to supply object age here */
DList * copy = (DList *)mm.alloc(typeseq::id<DList>(), sizeof(DList));
DList * copy = (DList *)mm.alloc_copy((std::byte *)&src);
if (copy)
*copy = src;