diff --git a/lualib/skynet.lua b/lualib/skynet.lua index 08a3fa13..abb568c8 100644 --- a/lualib/skynet.lua +++ b/lualib/skynet.lua @@ -95,7 +95,7 @@ end -- coroutine reuse -local coroutine_pool = {} +local coroutine_pool = setmetatable({}, { __mode = "kv" }) local function co_create(f) local co = table.remove(coroutine_pool) @@ -661,15 +661,10 @@ function skynet.memlimit(bytes) skynet.memlimit = nil -- set only once end -local function clear_pool() - coroutine_pool = {} -end - -- Inject internal debug framework local debug = require "skynet.debug" debug(skynet, { dispatch = skynet.dispatch_message, - clear = clear_pool, suspend = suspend, }) diff --git a/lualib/skynet/debug.lua b/lualib/skynet/debug.lua index 3d6ff33c..957a2588 100644 --- a/lualib/skynet/debug.lua +++ b/lualib/skynet/debug.lua @@ -20,7 +20,6 @@ function dbgcmd.MEM() end function dbgcmd.GC() - export.clear() collectgarbage "collect" end