This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local track={} | |
setmetatable(track,{__mode="v"}) | |
function setmetatable52(t,mt) | |
if mt.__gc then | |
local p = newproxy(true) | |
track[p] = t | |
getmetatable(p).__gc = function(p) | |
local mt = debug.getmetatable(t) | |
if mt and rawget(mt, "__gc") then | |
rawget(mt, "__gc")(t) |