xo-gc stack: streamline object pointer forwarding
This commit is contained in:
parent
d0a0cf0ad7
commit
fed2d03930
3 changed files with 38 additions and 2 deletions
|
|
@ -76,5 +76,5 @@
|
|||
attributes: [],
|
||||
},
|
||||
],
|
||||
router_facet_explicit_content: [ ],
|
||||
router_facet_explicit_content: []
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,5 +18,31 @@
|
|||
#include "detail/IGCObject_Xfer.hpp"
|
||||
#include "detail/RGCObject.hpp"
|
||||
|
||||
namespace xo {
|
||||
namespace mm {
|
||||
/** defined here to avoid #include cycle, since
|
||||
* template obj<AGCObject,DRepr> awkward to make available there
|
||||
**/
|
||||
template <typename Object>
|
||||
template <typename DRepr>
|
||||
void
|
||||
RCollector<Object>::forward_inplace(xo::facet::obj<AGCObject,DRepr> * p_obj)
|
||||
{
|
||||
this->forward_inplace(p_obj->iface(), (void **)&(p_obj->data_));
|
||||
}
|
||||
|
||||
template <typename Object>
|
||||
template <typename DRepr>
|
||||
void
|
||||
RCollector<Object>::forward_inplace(DRepr ** p_repr)
|
||||
{
|
||||
// fetch static interface for DRepr
|
||||
auto iface = xo::facet::impl_for<AGCObject,DRepr>();
|
||||
|
||||
this->forward_inplace(&iface, (void **)p_repr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* end GCObject.hpp */
|
||||
|
||||
/* end GCObject.hpp */
|
||||
|
|
@ -23,6 +23,16 @@ namespace xo {
|
|||
RCollector() = default;
|
||||
RCollector(DataPtr data) : Object{std::move(data)} {}
|
||||
|
||||
/** forward op in place. Defined in GCObject.hpp to avoid #include cycle **/
|
||||
template <typename DRepr>
|
||||
void forward_inplace(obj<AGCObject,DRepr> * p_obj);
|
||||
|
||||
/** another convenience template for forwarding.
|
||||
* Defined in RGCObject.hpp to avoid #include cycle.
|
||||
**/
|
||||
template <typename DRepr>
|
||||
void forward_inplace(DRepr ** pp_repr);
|
||||
|
||||
int32_t _typeseq() const noexcept { return O::iface()->_typeseq(); }
|
||||
size_type allocated(generation g, role r) const noexcept { return O::iface()->allocated(O::data(), g, r); }
|
||||
size_type reserved(generation g, role r) const noexcept { return O::iface()->reserved(O::data(), g, r); }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue