lua-users home
lua-l archive

Re: lua 5.4 calls __gc twice, sometimes

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


sorry, forgot to mention that I increment PROXY_COUNT each time I create a proxy object
PROXY_COUNT = PROXY_COUNT + 1
proxy = { id = PROXY_COUNT }
and confirmed the id is only increasing as new userdata is generated, and I also confirmed the cache access is working
  for k, v in pairs(wrappedUserdata) do
    if v == data then
      local uid = userdata.id(data)
      local kid = rawget(k, "id")
      assert(kid == uid, string.format("k.id[%d] != uid[%d]", kid, uid))
      return k
    end
  end
_______________________________________________
lua-l mailing list -- lua-l@lists.lua.org
To unsubscribe send an email to lua-l-leave@lists.lua.org

AltStyle によって変換されたページ (->オリジナル) /