xo-alloc: explicit typeseq arg to alloc

This commit is contained in:
Roland Conybeare 2026-01-02 10:20:19 -05:00
commit c1b0504fc1
4 changed files with 13 additions and 6 deletions

View file

@ -8,6 +8,7 @@
namespace xo {
using xo::mm::AGCObject;
using xo::facet::typeseq;
namespace scm {
static DList s_null(obj<AGCObject>(), nullptr);
@ -22,7 +23,7 @@ namespace xo {
DList::list(obj<AAllocator> mm,
obj<AGCObject> h1)
{
void * mem = mm.alloc(sizeof(DList));
void * mem = mm.alloc(typeseq::id<DList>(), sizeof(DList));
return new (mem) DList(h1, DList::null());
}
@ -32,7 +33,7 @@ namespace xo {
obj<AGCObject> h1,
obj<AGCObject> h2)
{
void * mem = mm.alloc(sizeof(DList));
void * mem = mm.alloc(typeseq::id<DList>(), sizeof(DList));
return new (mem) DList(h1, DList::list(mm, h2));
}

View file

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

View file

@ -11,6 +11,7 @@
namespace xo {
using xo::mm::AAllocator;
using xo::facet::obj;
using xo::facet::typeseq;
using std::size_t;
namespace scm {
@ -24,7 +25,8 @@ namespace xo {
IGCObject_DInteger::shallow_copy(const DInteger & src,
obj<AAllocator> mm) noexcept
{
DInteger * copy = (DInteger *)mm.alloc(sizeof(DInteger));
DInteger * copy = (DInteger *)mm.alloc(typeseq::id<DInteger>(),
sizeof(DInteger));
if (copy)
*copy = src;

View file

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