void LuaPlusGCFunction(void* s) { GCState* st = (GCState*)s; LuaState* state = (LuaState*)lua_getstateuserdata(st->L); if (!state) return; LuaObject* curObj = state->GetHeadObject()->m_next; while (curObj != state->GetTailObject()) { markobject(st, &curObj->m_object); curObj = curObj->m_next; } }
void LuaState::LuaPlusGCFunction(void* s) { lua_State* L = (lua_State*)s; LuaState* state = (LuaState*)lua_getstateuserdata(L); if (!state) return; global_State* g = G(L); LuaObject* curObj = state->GetHeadObject()->m_next; while (curObj != (LuaObject*)state->GetTailObject()) { markvalue(g, curObj->GetTObject()); curObj = ((MiniLuaObject*)curObj)->m_next; } }