[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: C API question
- From: Sam Roberts <vieuxtech@...>
- Date: Fri, 7 Jan 2011 17:14:04 -0800
On Fri, Jan 7, 2011 at 3:20 PM, liam mail <liam.list@googlemail.com> wrote:
> If anyone knows of a method of obtaining references to tables and functions
> in C (remembering that they may not be named) then I would love to hear it
> because to hear (read) "the need for luaL_ref diminished a lot" I found
> quite shocking.
Depends what is driving the referal. For example, I often need to find
the lua userdata that corresponds to a C struct/c++ object, I use a
weak table mapping lightuserdata back to the userdata that wraps it.
Its been a while since I've used the ref system. It gives you a number
you then have to store in C somewhere, usually a struct, so I just use
the pointer to the struct as the key into lua, rather than an int
stored in the struct.
Cheers,
Sam
- References:
- C API question, joao lobato
- Re: C API question, GrayFace
- Re: C API question, steve donovan
- Re: C API question, joao lobato
- Re: C API question, Roberto Ierusalimschy
- Re: C API question, Mark Hamburg
- Re: C API question, Roberto Ierusalimschy
- Re: C API question, Ralph Hempel
- Re: C API question, joshua simmons
- Re: C API question, liam mail