Skip to content
Snippets Groups Projects
Commit a23eab38 authored by 最萌小汐's avatar 最萌小汐
Browse files

gc param

parent 2c461c6f
No related branches found
No related tags found
No related merge requests found
......@@ -44,8 +44,8 @@ METAPATH = METAPATH and expanduser(METAPATH) or (ROOT:string() .. '/meta')
---@diagnostic disable-next-line: deprecated
debug.setcstacklimit(200)
collectgarbage('generational', 10, 50)
--collectgarbage('incremental', 150, 500, 0)
collectgarbage('generational', 5, 25)
--collectgarbage('incremental', 120, 120, 0)
log = require 'log'
log.init(ROOT, fs.path(LOGPATH) / 'service.log')
......
......@@ -10,7 +10,7 @@ local log = log
local xpcall = xpcall
local mathHuge = math.huge
local weakValueMT = { __mode = 'v' }
local weakMT = { __mode = 'kv' }
_ENV = nil
......@@ -106,7 +106,7 @@ function m.mergeResults(a, b)
return a
end
m.cacheTracker = setmetatable({}, weakValueMT)
m.cacheTracker = setmetatable({}, weakMT)
function m.flushCache()
if m.cache then
......@@ -115,7 +115,7 @@ function m.flushCache()
m.cacheVersion = files.globalVersion
m.cache = {}
m.cacheActiveTime = mathHuge
m.locked = setmetatable({}, weakValueMT)
m.locked = setmetatable({}, weakMT)
m.cacheTracker[m.cache] = true
end
......@@ -125,7 +125,7 @@ function m.getCache(name, weak)
end
m.cacheActiveTime = timer.clock()
if not m.cache[name] then
m.cache[name] = weak and setmetatable({}, weakValueMT) or {}
m.cache[name] = weak and setmetatable({}, weakMT) or {}
end
return m.cache[name]
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment