diff options
-rw-r--r-- | main.lua | 4 | ||||
-rw-r--r-- | script/vm/vm.lua | 8 |
2 files changed, 6 insertions, 6 deletions
@@ -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') diff --git a/script/vm/vm.lua b/script/vm/vm.lua index a9c788fc..b2f420df 100644 --- a/script/vm/vm.lua +++ b/script/vm/vm.lua @@ -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 |