cocos2d-lua提供了复制方法clone(),源码如下: function clone(object) local lookup_table = {} local function _copy(object) if type(object) ~= "table" then return object elseif lookup_table[object] then return lookup_table[object] end local newObject = {} looku…
lua weak table 经常看到lua表中有 weak table的用法, 例如: weak_table = setmetatable({}, {__mode="v"}) 官网上的解释: http://www.lua.org/pil/17.html Weak tables are the mechanism that you use to tell Lua that a reference should not prevent the reclamation of an obje…