class method
ObjectSpace.allocation_method_id
(untyped) -> ::Symbol
allocation_method_id(object) → string
ext/objspace/object_tracing.c
View on GitHub ↗
static VALUE
allocation_method_id(VALUE self, VALUE obj)
{
struct allocation_info *info = lookup_allocation_info(obj);
if (info) {
return info->mid;
}
else {
return Qnil;
}
}
Returns the method identifier for the given object.
Example
class A include ObjectSpace def foo trace_object_allocations do obj = Object.new p "#{allocation_class_path(obj)}##{allocation_method_id(obj)}" end end end A.new.foo #=> "Class#new"
See ::trace_object_allocations for more information and examples.
See also
.allocation_generation
.allocation_sourcefile
.allocation_class_path
.allocation_sourceline
also in
4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0