diff options
author | Hans Hagen <pragma@wxs.nl> | 2020-01-26 19:35:43 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2020-01-26 19:35:43 +0100 |
commit | 43fc66771a0c9d27cc0b7fe7a69392ea313bd0ca (patch) | |
tree | 9b339c63cd28528e5062fe980e964808df619374 /tex/context/base/mkiv/node-res.lua | |
parent | 5189b2143a30a39cd3533569cbef3f06422cc1d9 (diff) | |
download | context-43fc66771a0c9d27cc0b7fe7a69392ea313bd0ca.tar.gz |
2020-01-26 18:37:00
Diffstat (limited to 'tex/context/base/mkiv/node-res.lua')
-rw-r--r-- | tex/context/base/mkiv/node-res.lua | 13 |
1 files changed, 8 insertions, 5 deletions
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) |