From 43fc66771a0c9d27cc0b7fe7a69392ea313bd0ca Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Sun, 26 Jan 2020 19:35:43 +0100 Subject: 2020-01-26 18:37:00 --- tex/context/base/mkiv/node-res.lua | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'tex/context/base/mkiv/node-res.lua') diff --git a/tex/context/base/mkiv/node-res.lua b/tex/context/base/mkiv/node-res.lua index 4347fad47..a27f5c4e5 100644 --- a/tex/context/base/mkiv/node-res.lua +++ b/tex/context/base/mkiv/node-res.lua @@ -559,8 +559,7 @@ local function cleanup(nofboxes) -- todo return nr, nl, nofboxes -- can be nil end - -local function usage() +local usage = CONTEXTLMTXMODE > 0 and node.inuse or function() local t = { } for n, tag in gmatch(status.node_mem_usage,"(%d+) ([a-z_]+)") do t[tag] = tonumber(n) or 0 @@ -581,9 +580,13 @@ statistics.register("cleaned up reserved nodes", function() end) -- \topofboxstack statistics.register("node memory usage", function() -- comes after cleanup ! - local usage = status.node_mem_usage - if usage ~= "" then - return usage + local used = usage() + if next(used) then + local t, n = { }, 0 + for k, v in table.sortedhash(used) do + n = n + 1 ; t[n] = format("%s %s",v,k) + end + return table.concat(t,", ") end end) -- cgit v1.2.3