Re: Exposing C data via userdata and tables
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Exposing C data via userdata and tables
- From: Wim Couwenberg <wcou@...>
- Date: 2005年3月30日 08:46:36 +0200
I am curious how you make the userdata private to the Lua object?
I put the word private in quotes :-) It is actually under a __data
index in the table. I'm one of those guys that think that public vs.
private discussions are irrelevant.
... I was worried that
scripting could 'disassociate' my C object by directly modifying the table.
It can. :-) Just stop worrying about it...!
Also, how do you handle GC? I thought light userdata and Lua tables can
not have __gc methods.
If gc is needed then I use a userdata in the __data field and give that
a __gc metamethod.
--
Wim