Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
class method
GC.add_stress_to_class
GC.add_stress_to_class(class[, ...])
gc.c
View on GitHub ↗
static VALUE
rb_gcdebug_add_stress_to_class(int argc, VALUE *argv, VALUE self)
{
rb_objspace_t *objspace = &rb_objspace;
if (!stress_to_class) {
set_stress_to_class(rb_ary_hidden_new(argc));
}
rb_ary_cat(stress_to_class, argv, argc);
return self;
}
Raises NoMemoryError when allocating an instance of the given classes.