function Operator:allocateStorage(size)
local db = self:acquireDatabase()
while db:getAvailableSpace() < size do
local dated_item = db:query{
number = 1,
tag = "emotion",
sort = "timestamp",
}
db:remove(dated_item)
end
local chunk = db:reserveSpace(size)
zeroMemory(chunk)
return chunk
end