mcode force allocation on Android is now optional

Anyone who encounters random freeze of koreader for Android
is encouraged to enable this by adding a file at
"/sdcard/koreader/patch.lua" with the content of:
```
require("jit.opt").start("sizemcode=256","maxmcode=256")
for i=1,100 do end  -- Force allocation of one large segment
```
The sizemcode and maxmcode could be adjusted from 196 to 512 to
make koreader best fit on your Android device.
This commit is contained in:
chrox
2015-03-20 10:03:17 +08:00
parent 5bb3b0ef89
commit a38d851a15
2 changed files with 4 additions and 1 deletions

View File

@@ -23,6 +23,9 @@ local file = A.jni:context(A.app.activity.vm, function(JNI)
end)
A.LOGI("intent file path " .. (file or ""))
-- run koreader patch before koreader startup
pcall(function() dofile("/sdcard/koreader/patch.lua") end)
-- create fake command-line arguments
arg = {"-d", file or "/sdcard"}
dofile(A.dir.."/reader.lua")