lua-users home
lua-l archive

[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