Closed griffindy closed 10 years ago
Thanks for the PR! specs look good. I'm thinking of adding a spec for your case. Out of curiosity, what Basic Object descendants were involved when you found this bug?
I can add the spec if you want, though I imagine you have your own system set up.
I happened across this while trying to profile something using sidekiq. Specifically, Redis::Future
is a BasicObject
, not really sure why.
LGTM. I'll write a spec as well.
If you try to use
AllocationStats.trace
and any descendant ofBasicObject
(but notObject
) is created during the block, it will fail from callingobject_id
andsend
.BasicObject
does not implement those two methods, but does use__id__
and__send__
.That was a simple refactor. The slightly more complicated problem is that
BasicObject#class
does not exist. I found a way to implement#class
by referencing the superclass of aBasicObject
's eigenclass.Let me know if there's anything else you want me to add to the pull request.
#__id__
instead of#object_id
#__send__
instead of#send
BasicObject
to give it #class using this hack found here: http://stackoverflow.com/a/10216927