We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
用的lua profiler作为分析工具,发现SafePack和ConcatSafePack这两个函数出现内存不停的增加的问题
The text was updated successfully, but these errors were encountered:
不是内存泄漏,这两个函数会创建table,分配内存 Bind和Broadcast使用频繁的项目估计要吐血
Sorry, something went wrong.
local emptyPack = { n = 0 } -- 解决原生pack的nil截断问题,SafePack与SafeUnpack要成对使用 function SafePack(...) local n = select('#', ...) if n <= 0 then return emptyPack else local params = { ... } params.n = n return params end end -- 解决原生unpack的nil截断问题,SafePack与SafeUnpack要成对使用 function SafeUnpack(safe_pack_tb) if safe_pack_tb == emptyPack then return nil else return unpack(safe_pack_tb, 1, safe_pack_tb.n) end end
目前我用的这种方式处理,也只能说缓解
No branches or pull requests
用的lua profiler作为分析工具,发现SafePack和ConcatSafePack这两个函数出现内存不停的增加的问题
The text was updated successfully, but these errors were encountered: