[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lua 5.4 calls __gc twice, sometimes
- From: 云风 Cloud Wu <cloudwu@...>
- Date: Sat, 25 Apr 2020 21:40:27 +0800
Payo Nel <payonel@hotmail.com> 于2020年4月25日周六 上午6:05写道:
>
> From: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
>
> > 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
> In my dispose callback, when this code segfaults, the id passed matches the id of the userdata id i stored at the beginging
> p->id == 274, lua_tointeger(L, 2) == 274
> p->id == 740, lua_tointeger(L, 2) == 740
If the __gc of a table proxy is being called twice, p->id in dispose
callback should be the same value with the last call.
I think you need to save at least two id (Including history) in the
userdata to make sure no more proxy wrap it at the same time , if the
userdata could be wrapped more than once.
_______________________________________________
lua-l mailing list -- lua-l@lists.lua.org
To unsubscribe send an email to lua-l-leave@lists.lua.org
- References:
- lua 5.4 calls __gc twice, sometimes, Payo Nel
- Re: lua 5.4 calls __gc twice, sometimes, Payo Nel
- Re: lua 5.4 calls __gc twice, sometimes, Roberto Ierusalimschy
- Re: lua 5.4 calls __gc twice, sometimes, Payo Nel
- Re: lua 5.4 calls __gc twice, sometimes, Roberto Ierusalimschy
- Re: lua 5.4 calls __gc twice, sometimes, Payo Nel