+ xo-alloc + xo-object + xo-alloc docs + GC utests

This commit is contained in:
Roland Conybeare 2025-08-03 15:59:38 -05:00
commit 5f46b51f12
32 changed files with 2903 additions and 82 deletions

45
src/alloc/Forwarding1.cpp Normal file
View file

@ -0,0 +1,45 @@
/* file Forwarding1.cpp
*
* author: Roland Conybeare, Aug 2025
*/
#include "Forwarding1.hpp"
#include <cstddef>
#include <cassert>
namespace xo {
namespace obj {
Forwarding1::Forwarding1(gp<Object> dest)
: dest_{dest}
{}
Object *
Forwarding1::_offset_destination(Object * src) const
{
intptr_t offset = src - static_cast<const Object *>(this);
return dest_.ptr() + offset;
}
std::size_t
Forwarding1::_shallow_size() const {
assert(false);
return 0;
}
Object *
Forwarding1::_shallow_copy() const {
assert(false);
return nullptr;
}
std::size_t
Forwarding1::_forward_children() {
assert(false);
return 0;
}
} /*namespace obj*/
} /*namespace xo*/
/* end Forwarding1.cpp */