[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: C API question
- From: Mark Hamburg <mark@...>
- Date: Fri, 7 Jan 2011 07:36:07 -0800
I would be happy to see refs go away because they seem like a sharp, tempting feature that actually doesn't add value.
If your userdata object needs to reference other Lua data, you really, really, really want to use the environment mechanism because this works with the GC whereas refs are very prone to creating uncollectable cycles.
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.
Mark