[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: C API question
- From: Doug Currie <doug.currie@...>
- Date: Mon, 10 Jan 2011 11:30:38 -0500
On Jan 10, 2011, at 7:14 AM, Daniel Silverstone wrote:
> I suggested that in a conversation a few of us were having recently (not on
> list or IRC) and it was pointed out to me that pushing and then looking up a
> light userdata in a table, may be more expensive than a rawgeti invocation.
One way to avoid Lua refs, and avoid using the global registry, is to associate callbacks (and other Lua objects needed by C) with small integer keys in a related full userdata environment (known as a uservalue in 5.2). However, when a callback from C happens, there is no documented way to convert a userdata pointer (void *), AKA block address, to a Lua object. I.e., what is the inverse of lua_touserdata?
e
- 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, Jerome Vuarand
- Re: C API question, Roberto Ierusalimschy
- Re: C API question, Daniel Silverstone