/** @file Blob.cpp * * @author Roland Conybeare, Nov 2025 **/ #include "Blob.hpp" #include "xo/reflect/Reflect.hpp" #include "xo/allocutil/IAlloc.hpp" namespace xo { using xo::reflect::Reflect; using xo::reflect::TaggedPtr; gp Blob::make(gc::IAlloc * mm, std::size_t z) { std::byte * mem = mm->alloc(sizeof(Blob) + z); return new (mem) Blob(z); } TaggedPtr Blob::self_tp() const { return Reflect::make_tp(const_cast(this)); } void Blob::display(std::ostream & os) const { os << ""; } std::size_t Blob::_shallow_size() const { return sizeof(Blob) + z_; } Object * Blob::_shallow_copy(gc::IAlloc * mm) const { Cpof cpof(mm, this); std::byte * cp_mem = mm->alloc_gc_copy(sizeof(Blob) + z_, this); gp copy = new (cp_mem) Blob(z_); ::memcpy(copy->data(), data_, z_); return copy.get(); } std::size_t Blob::_forward_children(gc::IAlloc *) { return this->_shallow_size(); } } /* end Blob.cpp */