xo-alloc: IAlloc* i/face sufficient for Object._forward_children

This commit is contained in:
Roland Conybeare 2025-11-24 12:58:54 -05:00
commit c5c9441c1e
19 changed files with 22 additions and 22 deletions

View file

@ -32,7 +32,7 @@ namespace xo {
/** required by Object i/face, but never called on Forwarding1 **/
virtual Object * _shallow_copy(gc::IAlloc * mm) const final override;
/** required by Object i/face, but never called on Forwarding1 **/
virtual std::size_t _forward_children(gc::GC * mm) final override;
virtual std::size_t _forward_children(gc::IAlloc * mm) final override;
private:
/** the object that used to be located at this address (i.e. @c this)

View file

@ -119,17 +119,17 @@ namespace xo {
* @p src. source object to be forwarded
* @p gc. garbage collector
*/
static Object * _forward(Object * src, gc::GC * gc);
static Object * _forward(Object * src, gc::IAlloc * gc);
template <typename T>
static void _forward_inplace(T ** src_addr, gc::GC * gc) {
static void _forward_inplace(T ** src_addr, gc::IAlloc * gc) {
Object * fwd = _forward(*src_addr, gc);
*src_addr = reinterpret_cast<T *>(fwd);
}
template <typename T>
static void _forward_inplace(gp<T> & src, gc::GC * gc) {
static void _forward_inplace(gp<T> & src, gc::IAlloc * gc) {
_forward_inplace<T>(src.ptr_address(), gc);
}
@ -243,7 +243,7 @@ namespace xo {
* allocated by @ref _shallow_move
*
**/
virtual std::size_t _forward_children(gc::GC * gc) = 0;
virtual std::size_t _forward_children(gc::IAlloc * gc) = 0;
};
template <typename T>