lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Fri, Jan 7, 2011 at 8:49 PM, GrayFace <sergroj@mail.ru> wrote:
> On 07.01.2011 21:36, Mark Hamburg wrote:
>>
>> If your C code needs to reference a Lua value, I tend to recommend using
>> light userdata keys in the registry bearing in mind that this creates
>> anchors for the GC.
>>
> Where can I read more about these GC anchors?
http://www.lua.org/pil/17.html

Also, probably some examples on the wiki.

> And this doesn't solve the problem for modules and other sorts of libraries.

Trying to guess what the "the problem" is, but for a module, you'd use
a lightuserdata of a pointer to something in your modules C
implementation, the module function, a static variable. C doesn't put
multiple things at the same pointer address, so it will be unique.

Sam