Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
class method
ObjectSpace.reachable_objects_from_root
ObjectSpace.reachable_objects_from_root → hash
ext/objspace/objspace.c
View on GitHub ↗
static VALUE
reachable_objects_from_root(VALUE self)
{
struct rofr_data data;
VALUE hash = data.categories = rb_ident_hash_new();
data.last_category = 0;
rb_objspace_reachable_objects_from_root(reachable_object_from_root_i, &data);
rb_hash_foreach(hash, collect_values_of_values, hash);
return hash;
}
- MRI specific feature
-
Return all reachable objects from root.
See also
.reachable_objects_from
.trace_object_allocations
.memsize_of_all
.trace_object_allocations_clear
also in
4.1 · 4.0 · 3.4 · 3.2 · 3.1 · 3.0