Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
class method
ObjectSpace.allocation_sourceline
(untyped) -> ::Integer
allocation_sourceline(object) → integer
ext/objspace/object_tracing.c
View on GitHub ↗
static VALUE
allocation_sourceline(VALUE self, VALUE obj)
{
struct allocation_info *info = lookup_allocation_info(obj);
if (info) {
return INT2FIX(info->line);
}
else {
return Qnil;
}
}
Returns the original line from source for from the given object.
See ::trace_object_allocations for more information and examples.
See also
.allocation_sourcefile
.count_imemo_objects
.allocation_method_id
.count_objects
also in
4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0