Closed benweint closed 11 years ago
Unfortunately rb_newobj_of
is not widely used, so this technique will not catch the majority of allocations.
@tmm1 hmm, my experimentation suggested the opposite - I got no results at all from the object allocation profiler on 2.0.0-p247 until I switched over to patching rb_newobj_of
. From my brief read, it looked like internal usage within MRI had switched over to rb_newobj_of
- are you referring to usage by 3rd-party C extensions?
Ah, you're right. Glad this is working.
The object allocation profiler currently works by patching the rb_newobj function in Ruby. This function is no longer directly used in Ruby 2.x - rb_newobj_of is used instead.
This change patches either rb_newobj or rb_newobj_of, depending on whether the targeted Ruby version has rb_newobj_of available.