2
0
mirror of https://github.com/koreader/koreader synced 2024-11-10 01:10:34 +00:00

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) end)
A.LOGI("intent file path " .. (file or "")) 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 -- create fake command-line arguments
arg = {"-d", file or "/sdcard"} arg = {"-d", file or "/sdcard"}
dofile(A.dir.."/reader.lua") dofile(A.dir.."/reader.lua")

@ -1 +1 @@
Subproject commit 64caed00259bb23b789f2a8051e77efa9bcde9cc Subproject commit 4c5c9f967418444d0ac20d775f0ae2a97a33d111