Rejig CBB toggling on startup to avoid an extra jit.flush (#7023)

* When the CBB is disabled, attempt to apply the JIT tweaks earlier,
avoiding the JIT code flush in the process

* Drop debug prints

* Bump base

https://github.com/koreader/koreader-base/pull/1263
https://github.com/koreader/koreader-base/pull/1264
pull/7043/head
NiLuJe 3 years ago committed by GitHub
parent 7df60ba0e4
commit 8e3a117c68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1 +1 @@
Subproject commit 6b46677563f490b570436703c235338ed1d72eea
Subproject commit 11de43f6f98fc13239308e394a6f7b2c082c1c27

@ -11,7 +11,7 @@ export LD_LIBRARY_PATH="/usr/local/Kobo"
cd /
unset OLDPWD
unset LC_ALL TESSDATA_PREFIX STARDICT_DATA_DIR EXT_FONT_DIR
unset KOREADER_DIR KO_NO_CBB KO_DONT_GRAB_INPUT
unset KOREADER_DIR KO_DONT_GRAB_INPUT
# Ensures fmon will restart. Note that we don't have to worry about reaping this, nickel kills on-animator.sh on start.
(

@ -29,6 +29,15 @@ io.stdout:flush()
-- they might call gettext on load
G_reader_settings = require("luasettings"):open(
DataStorage:getDataDir().."/settings.reader.lua")
-- Apply the JIT opt tweaks ASAP when the C BB is disabled,
-- because we want to avoid the jit.flush() from bb:enableCBB,
-- which only makes the mcode allocation issues worse on Android...
local is_cbb_enabled = G_reader_settings:nilOrFalse("dev_no_c_blitter")
if not is_cbb_enabled then
jit.opt.start("loopunroll=45")
end
local lang_locale = G_reader_settings:readSetting("language")
-- Allow quick switching to Arabic for testing RTL/UI mirroring
if os.getenv("KO_RTL") then lang_locale = "ar_AA" end
@ -41,7 +50,8 @@ local dummy = require("ffi/posix_h")
-- Try to turn the C blitter on/off, and synchronize setting so that UI config reflects real state
local bb = require("ffi/blitbuffer")
local is_cbb_enabled = bb:enableCBB(G_reader_settings:nilOrFalse("dev_no_c_blitter"))
bb:setUseCBB(is_cbb_enabled)
is_cbb_enabled = bb:enableCBB(G_reader_settings:nilOrFalse("dev_no_c_blitter"))
G_reader_settings:saveSetting("dev_no_c_blitter", not is_cbb_enabled)
-- Should check DEBUG option in arg and turn on DEBUG before loading other

Loading…
Cancel
Save