Hello.
Ruby 2.0 is all about "non breaking backward compatibility" right? <wink
wink>.
Anyway, I used to use this code in the ruby-prof gem to see a method is
the
allocator:
if (method_id == ID_ALLOCATOR)
result = rb_str_new2("allocate");
This fails to compile with 2.0 however:
rp_method.c:101: error: ID_ALLOCATOR undeclared (first use in this
function)
Any help/work arounds available?
Thanks.
-r
on 2012-11-08 18:38
on 2012-11-09 04:41
Hello Roger, 2012/11/9, Roger Pack <rogerdpack2@gmail.com>: > rp_method.c:101: error: ID_ALLOCATOR undeclared (first use in this > function) It looks deleted at r36925, for a refactoring (?) of #6993. It is easy to add the macro ID_ALLOCATOR, but the commit may affect ruby-prof in more essential way. For example, set_trace_func does not hook a call to #allocate method. (Note that I could be wrong; I just read #6993 and I don't read that commit itself.) Is this a matter for ruby-prof? Anyway I'll reopen #6993 and ask ko1 and nobu. Thank you,
on 2012-11-09 16:28
On Thu, Nov 8, 2012 at 8:40 PM, Yusuke Endoh <mame@tsg.ne.jp> wrote: > > > not hook a call to #allocate method. (Note that I could be wrong; > I just read #6993 and I don't read that commit itself.) Is this a > matter for ruby-prof? > It does seem that it is useful in today's ruby-prof for 1.9.x > > Anyway I'll reopen #6993 and ask ko1 and nobu. Thank you, > Thanks! -roger-
on 2012-11-09 19:14
Can I see ruby-prof code? Are there any reason that we can not modify ruby-prof code?
on 2012-11-09 19:33
On Fri, Nov 9, 2012 at 11:14 AM, SASADA Koichi <ko1@atdot.net> wrote: > Can I see ruby-prof code? > > Are there any reason that we can not modify ruby-prof code? > https://github.com/rdp/ruby-prof/blob/master/ext/r... Should I define ID_ALLOCATOR myself? That would work. -r
on 2012-11-09 20:04
(2012/11/10 3:26), Roger Pack wrote: > > https://github.com/rdp/ruby-prof/blob/master/ext/r... Thanks. > Should I define ID_ALLOCATOR myself? > That would work. If there is no problem, please patch it. Thoughts: (1) ID_ALLOCATOR is common or not? if ID_ALLOCATOR is used in many gems then we need to consider about adding ID_ALLOCATOR elsif it is easy to modify ruby-prof directly end (2) My recommendation #ifdef ID_ALLOCATOR if (mid == ID_ALLOCATOR) result = rb_str_new2("allocate"); else #endif if (mid == 0) result = rb_str_new2("[No method]"); else result = rb_String(ID2SYM(mid));
on 2012-11-09 21:14
> result = rb_String(ID2SYM(mid)); > Good idea. Or should I assume that ID_ALLOCATOR=1 will also apply for 2.0, so I can just assume it works?
on 2012-11-09 21:25
(2012/11/10 5:14), Roger Pack wrote: > > Good idea. Or should I assume that ID_ALLOCATOR=1 will also apply for > 2.0, so I can just assume it works? Nobu, what do you think about it? I think id==1 can be used by another purpose.
on 2012-11-20 03:59
(12/11/10 5:25), SASADA Koichi wrote: > (2012/11/10 5:14), Roger Pack wrote: As for ruby-prof, ID_ALLOCATOR code seems useless. >> Good idea. Or should I assume that ID_ALLOCATOR=1 will also apply for >> 2.0, so I can just assume it works? I'm not sure what you'll assume about an undefined symbol. > Nobu, what do you think about it? > > I think id==1 can be used by another purpose. Possibly.
on 2012-11-24 02:28
Roger, Ko1, Nobu, did you agree? 2012/11/20 Nobuyoshi Nakada <nobu@ruby-lang.org>:
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.