freeRow模块改名line模块并暂时在“行”的管理上不再那么节约地使用内存

This commit is contained in:
MrZ626
2021-11-09 20:14:08 +08:00
parent 230d67492e
commit b27aa8b60d
14 changed files with 46 additions and 70 deletions

22
parts/line.lua Normal file
View File

@@ -0,0 +1,22 @@
local LINE={}
local L={}--Storage
local len=0--Length
function LINE.new(val,isGarbage)
if len==0 then
for i=1,10 do
L[i]={0,0,0,0,0,0,0,0,0,0,garbage=false}
end
len=len+10
end
local t=L[len]
for i=1,10 do t[i]=val end
t.garbage=isGarbage==true
L[len]=nil
len=len-1
return t
end
function LINE.discard(t)
len=len+1
L[len]=t
end
return LINE