lua-users home
lua-l archive

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


Lawrie,

One warning: if the C library keeps the pointer for a long time a new object can end up at the same location as the old one, and it can get really hard to figure out what's going on. A 'ref' value is safer in that respect.

Ge'

Lawrie Nichols wrote:
Hi Patrick

On 12/08/09 02:09, Patrick Donnelly wrote:
Light Userdata and Numbers are both considered strong references in
any weak table.
You're absolutely right....I meant it weak-valued table (I should read my posts before hitting the send button...).

Also, passing a pointer to an integer on the stack is
just as simple in my opinion as passing a pointer returned from
lua_topointer.
Agreed. However, in my case I'll be getting a pointer (to my allocated UD) coming back from a third-party library. If I can use this pointer as the index, then that's going to be easiest for me at this stage.

Thanks for the help,

Lawrie