Closed valid-ptr closed 2 years ago
I see what's going on with the infinite loop. But fixing this is not trivial. I should keep the "structure" of what is being sent. For example, if a table references the same clonable userdata several times, querying the transfered table should also identify the same values as being equal.
Fixed by 909470be9f7ec1dd2d09ae1a371d69c9c652e957
I'am trying to change my "DeepPreluded" Userdata to "__lanesclone" mechanism in my app. For performance reason.
I use LuaJIT 2.1 (master) / Lua 5.1
There are few things goes wrong: 1) #188 2) Infinite loop: Let's suppose that self is laneclone'able userdata; Let's suppose we have function X with self in upvalues Function X stored inside self's fenv cause stack overflow while cloning. 3) UD can be variable size... It's easy to change __lanesclone's cfunction to receive 1 + 2 arguments against 0 + 2 arguments scheme. When 1 argument comes, it can be treated as source UD where size is stored. PS: It's not a good idea to create many metatables for each UD