[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: C API question
- From: Sam Roberts <vieuxtech@...>
- Date: Sun, 9 Jan 2011 09:49:13 -0800
On Fri, Jan 7, 2011 at 8:49 PM, GrayFace <firstname.lastname@example.org> 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?
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.