Rb_frame_last_func()

Hello!

I need to know from inside a C extension the Ruby method
which called a function (actually it is a C generic function
which serves a family of Ruby methods).

I do this:

char *methname = rb_id2name (rb_frame_last_func());

Is this the right way or is it time expensive? If it is not
the fastest way to retrieve the method name, can I do something
else?

Regards,

···


University of Athens I bet the human brain
Physics Department is a kludge --Marvin Minsky

Hi,

···

In message “rb_frame_last_func()” on 04/05/26, Elias Athanasopoulos elathan@phys.uoa.gr writes:

I do this:

char *methname = rb_id2name (rb_frame_last_func());

Is this the right way or is it time expensive? If it is not
the fastest way to retrieve the method name, can I do something
else?

I think it’s the right way. Calling rb_frame_last_func() is cheap.

						matz.

Is there a reason why rb_frame_last_func() exists? How does it differ
from ruby_frame->last_func?

Paul

···

On Wed, May 26, 2004 at 12:45:59PM +0900, Yukihiro Matsumoto wrote:

I think it’s the right way. Calling rb_frame_last_func() is cheap.

Hi,

···

In message “Re: rb_frame_last_func()” on 04/05/26, Paul Brannan pbrannan@atdesk.com writes:

Is there a reason why rb_frame_last_func() exists? How does it differ
from ruby_frame->last_func?

You don’t have to access internal structure which may be changed in
the future.

						matz.