mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
add standalone glyph cache
I found it will be especially helpful to cache glyph separately so that glyph caches won't be washed out by a single page cache.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
require "dbg"
|
||||
--[[
|
||||
Inheritable abstraction for cache items
|
||||
]]--
|
||||
@@ -29,8 +30,14 @@ Cache = {
|
||||
cache_order = {}
|
||||
}
|
||||
|
||||
function Cache:new(o)
|
||||
o = o or {}
|
||||
setmetatable(o, self)
|
||||
self.__index = self
|
||||
return o
|
||||
end
|
||||
|
||||
function Cache:insert(key, object)
|
||||
--@TODO add cache for different types of item 09.01 2013 (houqp)
|
||||
-- guarantee that we have enough memory in cache
|
||||
if(object.size > self.max_memsize) then
|
||||
-- we're not allowed to claim this much at all
|
||||
|
||||
Reference in New Issue
Block a user