xo-umbrella2/xo-object2/src/object2/DFloat.cpp
Roland Conybeare ec639ebb4b xo-interpreter2 stack: + reason arg to visit_gco_children()
Helps streamline DX1Collector in xo-gc/.
Want both forward and verify entry points for the same
representation.
2026-04-10 01:10:03 -04:00

45 lines
1,021 B
C++

/** @file DFloat.cpp
*
* @author Roland Conybeare, Dec 2025
**/
#include "DFloat.hpp"
#include <xo/indentlog/print/pretty.hpp>
namespace xo {
using xo::facet::typeseq;
using xo::print::ppdetail_atomic;
using std::size_t;
namespace scm {
DFloat *
DFloat::_box(obj<AAllocator> mm, double x)
{
void * mem = mm.alloc(typeseq::id<DFloat>(),
sizeof(DFloat));
return new (mem) DFloat(x);
}
bool
DFloat::pretty(const ppindentinfo & ppii) const
{
return ppdetail_atomic<double>::print_pretty(ppii, value_);
}
DFloat *
DFloat::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept
{
return gc.std_move_for(this);
}
void
DFloat::visit_gco_children(VisitReason, obj<AGCObjectVisitor>) noexcept
{
// noop -- childless!
}
} /*namespace scm*/
} /*namespace xo*/
/* end DFloat.cpp */