From e988df0fbdd9d568889a28640c189ae022e99f8e Mon Sep 17 00:00:00 2001 From: Kahrl Date: Sun, 2 Jun 2013 15:35:29 +0200 Subject: Add and implement setting max_clearobjects_extra_loaded_blocks. Now Environment::clearAllObjects() unloads unused blocks in an interval defined by max_clearobjects_extra_loaded_blocks (default 4096). --- src/map.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/map.h') diff --git a/src/map.h b/src/map.h index 31001e4c3..530d81e7a 100644 --- a/src/map.h +++ b/src/map.h @@ -279,6 +279,12 @@ public: void timerUpdate(float dtime, float unload_timeout, std::list *unloaded_blocks=NULL); + /* + Unloads all blocks with a zero refCount(). + Saves modified blocks before unloading on MAPTYPE_SERVER. + */ + void unloadUnreferencedBlocks(std::list *unloaded_blocks=NULL); + // Deletes sectors and their blocks from memory // Takes cache into account // If deleted sector is in sector cache, clears cache @@ -433,8 +439,8 @@ public: void endSave(); void save(ModifiedState save_level); - //void loadAll(); void listAllLoadableBlocks(std::list &dst); + void listAllLoadedBlocks(std::list &dst); // Saves map seed and possibly other stuff void saveMapMeta(); void loadMapMeta(); -- cgit v1.2.3