lua-users home
lua-l archive

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


  int gc_tagmethod(lua_State* L) {
    lua_pushuserdata(L, (void*) 0xbeef);  // leak is a side-effect from here!
    lua_pop(L, 1);
    return 0;

This is a "deficiency" of Lua. You cannot create new Lua objects during
a gc tagmethod (that is why we restricted the use of gc tagmethods in
later versions). But I am afraid the manual has a bug of not stating
this restriction clearly.

-- Roberto