xo-gc stack: + gc-report-object-types() primitive

This commit is contained in:
Roland Conybeare 2026-03-29 17:19:23 -04:00
commit 28cd1523fa
4 changed files with 66 additions and 7 deletions

View file

@ -112,6 +112,8 @@ namespace xo {
/** return value associated with @p key, if key is present **/
std::optional<obj<AGCObject>> lookup(const DString * key) const noexcept;
/** return value associated with @p key, if key is present **/
std::optional<obj<AGCObject>> lookup_cstr(const char * key) const noexcept;
/** return element @p key-value pair at position @p index (0-based) **/
std::pair<const DString *, obj<AGCObject>> at_index(size_type index) const;
@ -139,6 +141,11 @@ namespace xo {
**/
bool try_update(const pair_type & kvpair);
/** update key-value pair for existing @p key to map to @p value.
* false if @p key not already present.
**/
bool try_update_cstr(const char * key, obj<AGCObject> value);
/** convenience method:
* try_upsert pair (k, @p value), after boxing c-style string @p key with @p mm to get k
**/

View file

@ -35,6 +35,8 @@ namespace xo {
operator long() const noexcept { return value_; }
void assign_value(long x) noexcept { this->value_ = x; }
// GCObject facet
std::size_t shallow_size() const noexcept;