[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lua_closethread
- From: Peter Shook <pshook@...>
- Date: Mon, 14 Jul 2003 10:29:29 -0400
Nodir Temirhodzhaev wrote:
Is it correct store pointer to userdata outside lua tables? GC may change it's location?
Yes, you can store a C pointer to your userdata and use it however you like.
The GC is mark-sweep, so it will never copy or move your data. Your
userdata will stay at the same memory location until it is destroyed.
The __gc event will let you know when it is destroyed.
- Peter Shook