End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
ObjectSpace.trace_object_allocations_start
trace_object_allocations_start
ext/objspace/object_tracing.c
View on GitHub ↗
static VALUE
trace_object_allocations_start(VALUE self)
{
struct traceobj_arg *arg = get_traceobj_arg();
if (arg->running++ > 0) {
/* do nothing */
}
else {
if (arg->newobj_trace == 0) {
arg->newobj_trace = rb_tracepoint_new(0, RUBY_INTERNAL_EVENT_NEWOBJ, newobj_i, arg);
arg->freeobj_trace = rb_tracepoint_new(0, RUBY_INTERNAL_EVENT_FREEOBJ, freeobj_i, arg);
}
rb_tracepoint_enable(arg->newobj_trace);
rb_tracepoint_enable(arg->freeobj_trace);
}
return Qnil;
}
Starts tracing object allocations.
See also
.trace_object_allocations_debug_start
.trace_object_allocations_stop
.trace_object_allocations_clear
.undefine_finalizer
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.0