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:
Roland Conybeare 2026-03-29 13:44:19 -04:00
commit 375f8c1ec4
7 changed files with 64 additions and 135 deletions

View file

@ -139,6 +139,16 @@ namespace xo {
**/
bool try_update(const pair_type & kvpair);
/** convenience method:
* try_upsert pair (k, @p value), after boxing c-style string @p key with @p mm to get k
**/
bool try_upsert_cstr(obj<AAllocator> mm, const char * key, obj<AGCObject> value);
/** convenience method:
* upsert pair (k, @p value), after boxing c-style string @p key with @p mm to get k
**/
bool upsert_cstr(obj<AAllocator> mm, const char * key, obj<AGCObject> value);
/** upsert key-value pair @p kvpair into dictionary.
* If key kvpair.first not already present, add it.
* In either case replace/establish associated value with kvpair.second.
@ -210,7 +220,7 @@ namespace xo {
{
DDictionary * result = empty(mm, sizeof...(args));
if (result) {
(result->upsert(args), ...);
(result->upsert(mm, args), ...);
}
return result;
}

View file

@ -16,13 +16,14 @@ namespace xo {
struct DInteger {
using AAllocator = xo::mm::AAllocator;
using ACollector = xo::mm::ACollector;
using AGCObject = xo::mm::AGCObject;
using ppindentinfo = xo::print::ppindentinfo;
using value_type = long;
explicit DInteger(long x) : value_{x} {}
/** will likely want this to default to ANumeric, once we have it **/
template <typename AFacet>
template <typename AFacet = AGCObject>
static obj<AFacet, DInteger> box(obj<AAllocator> mm, long x);
/** allocate boxed value @p x using memory from @p mm **/