Refactored to use strictly locals

This commit is contained in:
HW
2013-10-18 22:38:07 +02:00
parent 8efdff65d3
commit ef111b99c6
107 changed files with 1987 additions and 1654 deletions

View File

@@ -1,26 +1,7 @@
--[[
Inheritable abstraction for cache items
--]]
CacheItem = {
size = 64, -- some reasonable default for simple Lua values / small tables
}
function CacheItem:new(o)
o = o or {}
setmetatable(o, self)
self.__index = self
return o
end
function CacheItem:onFree()
end
--[[
A global LRU cache
]]--
Cache = {
local Cache = {
-- cache configuration:
max_memsize = DGLOBAL_CACHE_SIZE,
-- cache state:
@@ -89,3 +70,5 @@ function Cache:clear()
self.cache_order = {}
self.current_memsize = 0
end
return Cache