summaryrefslogtreecommitdiff
path: root/tex/context/base/node-res.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2013-10-20 01:20:14 +0300
committerMarius <mariausol@gmail.com>2013-10-20 01:20:14 +0300
commit965214d981e6129b782c67adcaf3a81aedcb0bac (patch)
tree84f5945aae8efc9b6eb1898b873be5453cafe43d /tex/context/base/node-res.lua
parente7d0d90a434e5452ff9e86c8abab5a4cac35e2f1 (diff)
downloadcontext-965214d981e6129b782c67adcaf3a81aedcb0bac.tar.gz
stable 2013.05.28 00:36
Diffstat (limited to 'tex/context/base/node-res.lua')
-rw-r--r--tex/context/base/node-res.lua44
1 files changed, 8 insertions, 36 deletions
diff --git a/tex/context/base/node-res.lua b/tex/context/base/node-res.lua
index ca9d67f91..768aac404 100644
--- a/tex/context/base/node-res.lua
+++ b/tex/context/base/node-res.lua
@@ -35,9 +35,6 @@ local glyph_code = nodecodes.glyph
local allocate = utilities.storage.allocate
-local texgetbox = tex.getbox
-local texgetcount = tex.getcount
-
local reserved, nofreserved = { }, 0
local function register_node(n)
@@ -60,10 +57,11 @@ function pool.cleanup(nofboxes) -- todo
-- end
end
if nofboxes then
+ local tb = tex.box
for i=0,nofboxes do
- local l = texgetbox(i)
+ local l = tb[i]
if l then
- free_node(l) -- also list ?
+ free_node(tb[i])
nl = nl + 1
end
end
@@ -295,38 +293,12 @@ function pool.noad()
return copy_node(noad)
end
-function pool.hlist(list,width,height,depth)
- local n = copy_node(hlist)
- if list then
- n.list = list
- end
- if width then
- n.width = width
- end
- if height then
- n.height = height
- end
- if depth then
- n.depth = depth
- end
- return n
+function pool.hlist()
+ return copy_node(hlist)
end
-function pool.vlist(list,width,height,depth)
- local n = copy_node(vlist)
- if list then
- n.list = list
- end
- if width then
- n.width = width
- end
- if height then
- n.height = height
- end
- if depth then
- n.depth = depth
- end
- return n
+function pool.vlist()
+ return copy_node(vlist)
end
--[[
@@ -424,7 +396,7 @@ function pool.special(str)
end
statistics.register("cleaned up reserved nodes", function()
- return format("%s nodes, %s lists of %s", pool.cleanup(texgetcount("c_syst_last_allocated_box")))
+ return format("%s nodes, %s lists of %s", pool.cleanup(tex.count["c_syst_last_allocated_box"]))
end) -- \topofboxstack
statistics.register("node memory usage", function() -- comes after cleanup !