Hi,
I don't think it is similar to get the name of a variable. When Ruby
calls a method, in the background it must call a C function. I want to
get the pointer of this function, not its name.
The problem is in my case, someone else (the user) will define the method
in Ruby, and so I cannot record it when the method is defined.
Basically, in my extension, instead of writing
rb_funcall (obj, rb_intern ("func_name"), n, ...);
I just want to call the function directly, something like
func_name_ptr (obj, n, ...);
to reduce the overhead (because this call is done hundreds of thousands
times per second).
Regards,
Bill
===========================================================================
George Ogata <g_ogata / optushome.com.au> wrote:
> I think this is similar to trying to get the name of a variable referring
> to an instance. See thread starting at [ruby-talk: 44901] for why this is
> probably a dubious thing to do.
> Perhaps you can hash the method string to the method name(s) when you
> define it?