diff --git a/src/object2/IGCObject_DFloat.cpp b/src/object2/IGCObject_DFloat.cpp index 9d9a65d..be4849a 100644 --- a/src/object2/IGCObject_DFloat.cpp +++ b/src/object2/IGCObject_DFloat.cpp @@ -25,8 +25,7 @@ namespace xo { IGCObject_DFloat::shallow_copy(const DFloat & src, obj mm) noexcept { - DFloat * copy = (DFloat *)mm.alloc(typeseq::id(), - sizeof(DFloat)); + DFloat * copy = (DFloat *)mm.alloc_copy((std::byte *)&src); if (copy) *copy = src; diff --git a/src/object2/IGCObject_DInteger.cpp b/src/object2/IGCObject_DInteger.cpp index d6c80bb..cbc27f6 100644 --- a/src/object2/IGCObject_DInteger.cpp +++ b/src/object2/IGCObject_DInteger.cpp @@ -23,10 +23,9 @@ namespace xo { DInteger * IGCObject_DInteger::shallow_copy(const DInteger & src, - obj mm) noexcept + obj mm) noexcept { - DInteger * copy = (DInteger *)mm.alloc(typeseq::id(), - sizeof(DInteger)); + DInteger * copy = (DInteger *)mm.alloc_copy((std::byte *)&src); if (copy) *copy = src; diff --git a/src/object2/IGCObject_DList.cpp b/src/object2/IGCObject_DList.cpp index a30f2c6..2139d68 100644 --- a/src/object2/IGCObject_DList.cpp +++ b/src/object2/IGCObject_DList.cpp @@ -24,8 +24,7 @@ namespace xo { IGCObject_DList::shallow_copy(const DList & src, obj mm) noexcept { - /* FIXME: need to supply object age here */ - DList * copy = (DList *)mm.alloc(typeseq::id(), sizeof(DList)); + DList * copy = (DList *)mm.alloc_copy((std::byte *)&src); if (copy) *copy = src; diff --git a/utest/X1Collector.test.cpp b/utest/X1Collector.test.cpp index bc579e9..b15a0c5 100644 --- a/utest/X1Collector.test.cpp +++ b/utest/X1Collector.test.cpp @@ -194,14 +194,14 @@ namespace ut { REQUIRE(info.tseq() == typeseq::id().seqno()); REQUIRE(info.size() >= sizeof(DList)); REQUIRE(info.size() < sizeof(DList) + padding::c_alloc_alignment); - } } + + /* no GC roots, so GC is trivial */ c_o.request_gc(generation{1}); - } catch (std::exception & ex) { std::cerr << "caught exception: " << ex.what() << std::endl; REQUIRE(false);