make coroutine_pool weak would be better

This commit is contained in:
Cloud Wu
2016-06-06 16:21:59 +08:00
parent 27d69334ee
commit b8bb327f98
2 changed files with 1 additions and 7 deletions

View File

@@ -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,
})

View File

@@ -20,7 +20,6 @@ function dbgcmd.MEM()
end
function dbgcmd.GC()
export.clear()
collectgarbage "collect"
end