[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lua 5.4 calls __gc twice, sometimes
- From: Roberto Ierusalimschy <roberto@...>
- Date: Fri, 24 Apr 2020 17:03:51 -0300
> > - Does the bug happen in both modes (generational and incremental)?
> I have left the gc in its default mode, which I believe is inc mode. I have tested with: lua_gc(_state, LUA_GCGEN); and the bug still persists
The default mode in 5.4 is generational. You might change it to incremental
to check that.
One more question: can you be sure the __gc of a table is being called
twice? For what I saw in your code (the first version you sent), the
problem of destroying the same userdata twice could be caused by
some bug in the weak table, if it returned the same userdata for
two different tables. That is, when cleaning the weak table from a
deleted key, it might get corrupted and then could return a wrong
value in a future query.
Again, many thanks,
-- Roberto
_______________________________________________
lua-l mailing list -- lua-l@lists.lua.org
To unsubscribe send an email to lua-l-leave@lists.lua.org