diff options
author | Karl Berry <karl@freefriends.org> | 2020-03-05 00:48:46 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-03-05 00:48:46 +0000 |
commit | f210bce174e1f2f05305ab03e88e120a1cbfc4da (patch) | |
tree | 5c4e2ad096b5c745e859516ac3196fa0864292d5 /Master/texmf-dist/tex/context/base/mkiv/luat-cnf.lua | |
parent | 35fd641a3546acc0c62e0aa7f134888e36da30d4 (diff) |
context (from cont-tmf.zip of Feb 17 16:00, size 116339406)
git-svn-id: svn://tug.org/texlive/trunk@54086 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/luat-cnf.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/luat-cnf.lua | 59 |
1 files changed, 47 insertions, 12 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/luat-cnf.lua b/Master/texmf-dist/tex/context/base/mkiv/luat-cnf.lua index 5e3f026e95b..4939b05c39c 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/luat-cnf.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/luat-cnf.lua @@ -31,7 +31,8 @@ texconfig.param_size = 25000 texconfig.save_size = 100000 texconfig.stack_size = 10000 texconfig.function_size = 32768 -texconfig.properties_size = 65536 +texconfig.properties_size = 10000 +texconfig.fix_mem_init = 750000 local stub = [[ @@ -60,18 +61,37 @@ function texconfig.init() libraries = { -- we set it here as we want libraries also 'indexed' basiclua = { - "string", "table", "coroutine", "debug", "file", "io", "lpeg", "math", "os", "package", "bit32", + -- always + "string", "table", "coroutine", "debug", "file", "io", "lpeg", "math", "os", "package", + -- bonus + "bit32", "utf8", }, - basictex = { -- noad - "callback", "font", "img", "lang", "lua", "node", "pdf", "status", "tex", "texconfig", "texio", "token", + basictex = { + -- always + "callback", "font", "lang", "lua", "node", "status", "tex", "texconfig", "texio", "token", + -- not in luametatex + "img", "pdf", }, extralua = { - "gzip", "zip", "zlib", "lfs", "ltn12", "mime", "socket", "md5", "fio", "unicode", "utf", + -- not in luametatex + "unicode", "utf", "gzip", "zip", "zlib", + -- in luametatex + "xzip", "xmath", "xcomplex", "basexx", + -- maybe some day in luametatex + "lz4", "lzo", + -- always (mime can go) + "lfs","socket", "mime", "md5", "sha2", "fio", "sio", }, extratex = { - "epdf", "kpse", "mplib", -- "fontloader", + -- not in luametatex + "kpse", + -- always + "pdfe", "mplib", + -- in luametatex + "pdfdecode", "pngdecode", }, obsolete = { + "epdf", "fontloader", -- can be filled by luat-log "kpse", }, @@ -102,7 +122,7 @@ function texconfig.init() local tv = type(gv) if tv == "table" then for k, v in next, gv do - keys[k] = tostring(v) -- true -- by tostring we cannot call overloades functions (security) + keys[k] = tostring(v) -- true -- by tostring we cannot call overloads functions (security) end end lib[v] = keys @@ -121,16 +141,29 @@ function texconfig.init() -- shortcut and helper - local setbytecode = lua.setbytecode - local getbytecode = lua.getbytecode + local setbytecode = lua.setbytecode + local getbytecode = lua.getbytecode + local callbytecode = lua.callbytecode or function(i) + local b = getbytecode(i) + if type(b) == "function" then + b() + return true + else + return false + end + end local function init(start) local i = start local t = os.clock() while true do - local b = getbytecode(i) + -- local b = callbytecode(i) + local e, b = pcall(callbytecode,i) + if not e then + print(string.format("\nfatal error : unable to load bytecode register %%i, maybe wipe the cache first\n",i)) + os.exit() + end if b then - b() ; setbytecode(i,nil) ; i = i + 1 else @@ -218,7 +251,9 @@ local function makestub() t[#t+1] = format("texconfig.%s=%s",v,tv) end end - io.savedata(name,format("%s\n\n%s",concat(t,"\n"),format(stub,firsttable,tostring(CONTEXTLMTXMODE) or 0))) + t[#t+1] = "" + t[#t+1] = format(stub,firsttable,tostring(CONTEXTLMTXMODE or 0)) + io.savedata(name,concat(t,"\n")) logs.newline() end |