xo-ordinaltree: GC test [wip]

This commit is contained in:
Roland Conybeare 2025-12-01 22:25:41 -05:00
commit fd6bdd93c3
2 changed files with 8 additions and 13 deletions

View file

@ -144,9 +144,17 @@ namespace xo {
using GcCopyCallbackSet = xo::fn::UpCallbackSet<GcCopyCallback>;
using nanos = decltype(xo::qty::qty::nanosecond);
/** rebind is for typed allocators. since IAlloc is untyped,
* we want degenerate version
**/
template <typename U>
struct rebind { using other = GC; };
public:
/** create new GC instance with configuration @p config **/
explicit GC(const Config & config);
/** noncopyable **/
GC(const GC & other) = delete;
virtual ~GC();
/** create GC allocator.

View file

@ -141,19 +141,6 @@ namespace xo {
std::ostream &
operator<< (std::ostream & os, gp<Object> x);
/** @class Cpof
* @brief argument to operator new used for garbage collector evacuation phase
*
* Tag overloaded operator new to activate allocation policy based on location
* in memory of source object.
**/
class Cpof {
public:
explicit Cpof(gc::IAlloc * mm, const Object * src) : mm_{mm}, src_{src} {}
gc::IAlloc * mm_ = nullptr;
const void * src_ = nullptr;
};
} /*namespace xo*/
void * operator new (std::size_t z, const xo::Cpof & copy);