summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-04-12 14:24:38 +0800
committersumneko <sumneko@hotmail.com>2019-04-12 14:24:38 +0800
commitd402f6fed15c9ba61edf7f6b7b22e648c7cded34 (patch)
tree5548c2dafc91a7d86f554090d06c9626c6cd988a
parent37391cdd8171d70bcdbb90846636c0fb68b67be3 (diff)
downloadlua-language-server-d402f6fed15c9ba61edf7f6b7b22e648c7cded34.zip
减少清理频率,但会略微增加内存
-rw-r--r--server/src/vm/chain.lua2
-rw-r--r--server/src/vm/value.lua6
2 files changed, 4 insertions, 4 deletions
diff --git a/server/src/vm/chain.lua b/server/src/vm/chain.lua
index a8ff01fa..6e7c6ac7 100644
--- a/server/src/vm/chain.lua
+++ b/server/src/vm/chain.lua
@@ -27,7 +27,7 @@ function mt:clearCache()
end
end
self.count = n
- self.max = self.count + 10
+ self.max = self.count * 1.1 + 10
if self.max < self.min then
self.max = self.min
end
diff --git a/server/src/vm/value.lua b/server/src/vm/value.lua
index 7eb7784e..06a86e23 100644
--- a/server/src/vm/value.lua
+++ b/server/src/vm/value.lua
@@ -224,7 +224,7 @@ function mt:flushChild()
end
end
infos._count = count
- infos._limit = count + 10
+ infos._limit = count * 1.1 + 10
infos._version = listMgr.getVersion()
for index in pairs(self._child) do
if not alived[index] then
@@ -404,7 +404,7 @@ function mt:addInfo(tp, source, ...)
end
end
infos._count = count
- infos._limit = count + 10
+ infos._limit = count * 1.1 + 10
infos._version = version
end
end
@@ -422,7 +422,7 @@ function mt:eachInfo(callback)
end
end
infos._count = #list
- infos._limit = infos._count + 10
+ infos._limit = infos._count * 1.1 + 10
infos._version = listMgr.getVersion()
table.sort(list, function (a, b)
return a._sort < b._sort