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

调一下垃圾回收的参数

parent d2555c83
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,7 @@ ROOT = fs.path(rootPath)
LANG = LANG or 'en-US'
debug.setcstacklimit(200)
collectgarbage('generational', 10, 50)
collectgarbage('generational', 10, 100)
--collectgarbage('incremental', 120, 120, 0)
log = require 'log'
......
......@@ -358,10 +358,25 @@ function m.flushCache()
for _, file in pairs(m.fileMap) do
file.cacheActiveTime = math.huge
file.ast = nil
file.lines = nil
file.cache = {}
end
end
function m.flushFileCache(uri)
if platform.OS == 'Windows' then
uri = uri:lower()
end
local file = m.fileMap[uri]
if not file then
return
end
file.cacheActiveTime = math.huge
file.ast = nil
file.lines = nil
file.cache = {}
end
local function init()
--TODO 可以清空文件缓存,之后看要不要启用吧
--timer.loop(10, function ()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment