mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 03:53:09 +00:00
make coroutine_pool weak would be better
This commit is contained in:
@@ -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,
|
||||
})
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@ function dbgcmd.MEM()
|
||||
end
|
||||
|
||||
function dbgcmd.GC()
|
||||
export.clear()
|
||||
collectgarbage "collect"
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user