summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-06-18 20:00:54 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-06-18 20:00:54 +0800
commita23eab388cd3d257a36edd1a784dc17e62d79e8a (patch)
tree3b02e560868d3c6efbefdf7ec1fc9d1f88e4f5b8 /script
parent2c461c6fc0a46b9ef44293dc9d8524b60d5c1f75 (diff)
downloadlua-language-server-a23eab388cd3d257a36edd1a784dc17e62d79e8a.zip
gc param
Diffstat (limited to 'script')
-rw-r--r--script/vm/vm.lua8
1 files changed, 4 insertions, 4 deletions
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