On 9/13/06, Lyle Johnson <lyle.johnson / gmail.com> wrote:
> On 9/13/06, John Gabriele <jmg3000 / gmail.com> wrote:
>
> > When you load an extension module, what's the mechanism that makes
> > those C calls (the ones that call into the Ruby API) actually get
> > connected to the currently-running instance of ruby?
>
> When you use the "require" method to load an extension module,
> [snip insightful explanation]
> Hope this helps,

Thanks for the explanation Lyle. I'm sorry, but perhaps I was unclear
(and also still not understanding this). I'm looking to find out the
mechanism at work *at link-edit time*, when you're building the
extension module. I mean, what are the args necessary to pass to gcc
to tell it that, when your code makes those rb_foo calls, those calls
are actually supposed to bind to something besides a .so file sitting
on your harddisk?

I can at least guess that, when Ruby loads the extension module, at
that point it can probably do some magic to make sure the C calls in
the extension module actually call code that's already loaded in
memory (from inside the ruby binary itself). But what I'd like to
understand is how to tell gcc this is the way it's going to go happen
at runtime.

Thanks,
---John