xo-gc stack: + request-gc-statistics() primitive
1. xo-gc now depends on xo-object2. 2. use genfacet for ICollector_DX1Collector 3. moves xo-gc utest previously in xo-object2 to more natural location in xo-gc/
This commit is contained in:
parent
7916971dc1
commit
f7c269a505
13 changed files with 74 additions and 11 deletions
|
|
@ -21,23 +21,35 @@ namespace xo {
|
|||
|
||||
// ----- report-gc-status -----
|
||||
|
||||
#ifdef NOT_YET
|
||||
obj<AGCObject>
|
||||
xfer_report_gc_status(obj<ARuntimeContext> rcx)
|
||||
xfer_report_gc_statistics(obj<ARuntimeContext> rcx)
|
||||
{
|
||||
bool have_gc = false;
|
||||
|
||||
if (rcx.collector()) {
|
||||
// status currently only implemented for X1 collector
|
||||
|
||||
auto gc = obj<ACollector,DX1Collector>::from(rcx.collector());
|
||||
|
||||
obj<AGCObject> stats;
|
||||
bool ok = rcx.collector().report_statistics(rcx.allocator(),
|
||||
rcx.error_allocator(),
|
||||
&stats);
|
||||
|
||||
if (ok && stats)
|
||||
return stats;
|
||||
}
|
||||
|
||||
return DBoolean::box(rcx.allocator(), false);
|
||||
}
|
||||
#endif
|
||||
|
||||
DPrimitive_gco_0 *
|
||||
GcPrimitives::make_report_gc_statistics_pm(obj<AAllocator> mm,
|
||||
StringTable * stbl)
|
||||
{
|
||||
(void)stbl;
|
||||
|
||||
auto any_ty = DAtomicType::make(mm, Metatype::t_any());
|
||||
auto pm_ty = obj<AType,DFunctionType>(DFunctionType::_make(mm, any_ty));
|
||||
|
||||
return DPrimitive_gco_0::_make(mm, "report-gc-statistics", pm_ty, &xfer_report_gc_statistics);
|
||||
}
|
||||
|
||||
// ----- request-gc -----
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue