From 7d024ed38ca89da57f163b54f30f0bb5c9dad8bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Fri, 9 Dec 2022 04:22:07 +0800 Subject: use weak table for node cache --- script/vm/node.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'script/vm/node.lua') diff --git a/script/vm/node.lua b/script/vm/node.lua index 58784d24..2e408128 100644 --- a/script/vm/node.lua +++ b/script/vm/node.lua @@ -4,9 +4,10 @@ local vm = require 'vm.vm' local ws = require 'workspace.workspace' local guide = require 'parser.guide' local timer = require 'timer' +local util = require 'utility' ---@type table -vm.nodeCache = {} +vm.nodeCache = setmetatable({}, util.MODE_K) ---@alias vm.node.object vm.object | vm.global -- cgit v1.2.3