|
|
@ -26,14 +26,9 @@ local Screen = require("ui/screen")
|
|
|
|
|
|
|
|
|
|
|
|
local ReaderUI = require("apps/reader/readerui")
|
|
|
|
local ReaderUI = require("apps/reader/readerui")
|
|
|
|
|
|
|
|
|
|
|
|
Profiler = nil
|
|
|
|
local Profiler = nil
|
|
|
|
|
|
|
|
|
|
|
|
function exitReader()
|
|
|
|
function exitReader()
|
|
|
|
if Profiler ~= nil then
|
|
|
|
|
|
|
|
Profiler:stop()
|
|
|
|
|
|
|
|
Profiler:dump("./profile.html")
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
G_reader_settings:close()
|
|
|
|
G_reader_settings:close()
|
|
|
|
|
|
|
|
|
|
|
|
input.closeAll()
|
|
|
|
input.closeAll()
|
|
|
@ -56,6 +51,7 @@ function exitReader()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if Profiler then Profiler.stop() end
|
|
|
|
os.exit(0)
|
|
|
|
os.exit(0)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
@ -146,14 +142,8 @@ while argidx <= #ARGV do
|
|
|
|
elseif arg == "-d" then
|
|
|
|
elseif arg == "-d" then
|
|
|
|
DEBUG:turnOn()
|
|
|
|
DEBUG:turnOn()
|
|
|
|
elseif arg == "-p" then
|
|
|
|
elseif arg == "-p" then
|
|
|
|
local lulip = require("ffi/lulip")
|
|
|
|
Profiler = require("jit.p")
|
|
|
|
Profiler = lulip:new()
|
|
|
|
Profiler.start("la")
|
|
|
|
pcall(function()
|
|
|
|
|
|
|
|
-- set maxrows only if the optional arg is numeric
|
|
|
|
|
|
|
|
Profiler:maxrows(ARGV[argidx] + 0)
|
|
|
|
|
|
|
|
argidx = argidx + 1
|
|
|
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
Profiler:start()
|
|
|
|
|
|
|
|
else
|
|
|
|
else
|
|
|
|
-- not a recognized option, should be a filename
|
|
|
|
-- not a recognized option, should be a filename
|
|
|
|
argidx = argidx - 1
|
|
|
|
argidx = argidx - 1
|
|
|
|