From 3fccc67eb7c530c280e9b496e22288ffa772152d Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sun, 26 Jun 2011 21:53:11 +0300 Subject: fixed block unloading from memory (a better fix coming next) --- src/map.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/map.h') diff --git a/src/map.h b/src/map.h index c64f8cbdb..2fe749007 100644 --- a/src/map.h +++ b/src/map.h @@ -230,13 +230,18 @@ public: Updates usage timers */ void timerUpdate(float dtime); - + + // Deletes sectors and their blocks from memory // Takes cache into account - // sector mutex should be locked when calling - void deleteSectors(core::list &list, bool only_blocks); + // If deleted sector is in sector cache, clears cache + void deleteSectors(core::list &list); - // Returns count of deleted sectors - u32 unloadUnusedData(float timeout, bool only_blocks=false, + /* + Unload unused data + = flush changed to disk and delete from memory, if usage timer of + block is more than timeout + */ + void unloadUnusedData(float timeout, core::list *deleted_blocks=NULL); // For debug printing -- cgit v1.2.3