xo-ordinaltree: GC test [wip]
This commit is contained in:
parent
b32b9151da
commit
fd6bdd93c3
2 changed files with 8 additions and 13 deletions
|
|
@ -144,9 +144,17 @@ namespace xo {
|
||||||
using GcCopyCallbackSet = xo::fn::UpCallbackSet<GcCopyCallback>;
|
using GcCopyCallbackSet = xo::fn::UpCallbackSet<GcCopyCallback>;
|
||||||
using nanos = decltype(xo::qty::qty::nanosecond);
|
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:
|
public:
|
||||||
/** create new GC instance with configuration @p config **/
|
/** create new GC instance with configuration @p config **/
|
||||||
explicit GC(const Config & config);
|
explicit GC(const Config & config);
|
||||||
|
/** noncopyable **/
|
||||||
|
GC(const GC & other) = delete;
|
||||||
virtual ~GC();
|
virtual ~GC();
|
||||||
|
|
||||||
/** create GC allocator.
|
/** create GC allocator.
|
||||||
|
|
|
||||||
|
|
@ -141,19 +141,6 @@ namespace xo {
|
||||||
std::ostream &
|
std::ostream &
|
||||||
operator<< (std::ostream & os, gp<Object> x);
|
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*/
|
} /*namespace xo*/
|
||||||
|
|
||||||
void * operator new (std::size_t z, const xo::Cpof & copy);
|
void * operator new (std::size_t z, const xo::Cpof & copy);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue