diff options
author | Philipp Gesang <phg42.2a@gmail.com> | 2014-05-05 07:47:48 +0200 |
---|---|---|
committer | Philipp Gesang <phg42.2a@gmail.com> | 2014-05-05 07:47:48 +0200 |
commit | cc7cbd37b22131aa81a58be88da43ad15ea18436 (patch) | |
tree | 056896d2b982ad976e9db1af641913b10c27afce /lualibs-trac-inf.lua | |
parent | d758aba692b362c8653e1e4b1b5c13df4346652b (diff) | |
parent | c1310e04a23cfe5d3d795b7e09d91599a3c916a5 (diff) | |
download | lualibs-cc7cbd37b22131aa81a58be88da43ad15ea18436.tar.gz |
Merge pull request #24 from phi-gamma/master
update to 2.1b
Diffstat (limited to 'lualibs-trac-inf.lua')
-rw-r--r-- | lualibs-trac-inf.lua | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/lualibs-trac-inf.lua b/lualibs-trac-inf.lua index 802f2e6..034726f 100644 --- a/lualibs-trac-inf.lua +++ b/lualibs-trac-inf.lua @@ -12,7 +12,7 @@ if not modules then modules = { } end modules ['trac-inf'] = { -- and rawget. local type, tonumber, select = type, tonumber, select -local format, lower = string.format, string.lower +local format, lower, find = string.format, string.lower, string.find local concat = table.concat local clock = os.gettimeofday or os.clock -- should go in environment @@ -123,7 +123,8 @@ function statistics.show() -- this code will move local register = statistics.register register("used platform", function() - return format("%s, type: %s, binary subtree: %s",os.platform or "unknown",os.type or "unknown", environment.texos or "unknown") + return format("%s, type: %s, binary subtree: %s", + os.platform or "unknown",os.type or "unknown", environment.texos or "unknown") end) register("luatex banner", function() return lower(status.banner) @@ -136,16 +137,25 @@ function statistics.show() return format("%s direct, %s indirect, %s total", total-indirect, indirect, total) end) if jit then - local status = { jit.status() } - if status[1] then - register("luajit status", function() - return concat(status," ",2) - end) + local jitstatus = { jit.status() } + if jitstatus[1] then + register("luajit options", concat(jitstatus," ",2)) end end -- so far -- collectgarbage("collect") - register("current memory usage",statistics.memused) + register("lua properties",function() + local list = status.list() + local hashchar = tonumber(list.luatex_hashchars) + local mask = lua.mask or "ascii" + return format("engine: %s, used memory: %s, hash type: %s, hash chars: min(%s,40), symbol mask: %s (%s)", + jit and "luajit" or "lua", + statistics.memused(), + list.luatex_hashtype or "default", + hashchar and 2^hashchar or "unknown", + mask, + mask == "utf" and "τεχ" or "tex") + end) register("runtime",statistics.runtime) logs.newline() -- initial newline for i=1,#statusinfo do |