ObjectSpace#allocation_class_path not working as expected

21 views
Skip to first unread message

Rajeev Bharshetty

unread,
Jun 12, 2014, 6:06:49 AM6/12/14
to rubyonra...@googlegroups.com
Using Ruby Version 2.1.2


class A
  def foo
    ObjectSpace::trace_object_allocations do
      obj = Object.new
      p "#{ObjectSpace::allocation_class_path(obj)}"
    end
  end
end

A.new.foo #=> "Class"
The above method is expected to return back the allocation class path of the object.
But I am getting an empty string back instead of "Class".
Is it an implementation bug in the method or the documentation is not updated.


Thanks
Reply all
Reply to author
Forward
0 new messages