lua-users home
lua-l archive

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


Hello Nodir,

Monday, July 14, 2003, 10:26:36 AM, you wrote:

NT> Next code incorrect?
NT> --------
NT> lua_State *thr = lua_newthread (L);
NT> lua_pop (L, 1);

lua_setgcthreshold(L, 0);

(Add this line to force GC)

NT> lua_pushnil (thr);

Test crashes with 'access violation'.

NT> --------
NT> Ie in lua tables not exist reference to thread and it collected?
Yes.

NT> IMO, userdata stored in table. Is it correct store pointer to
NT> userdata outside lua tables? GC may change it's location?
GC may collect any value which not referenced by some table (key or
value).


Dmitry Shubin

----