1
0

Configurable dirty unused chunk cap to avoid RAM overuse (#3359)

Configurable dirty unused chunk cap to avoid RAM overuse
This commit is contained in:
LogicParrot
2016-09-03 18:38:29 +03:00
committed by GitHub
parent 90be4e7efd
commit 7e9e7f7911
7 changed files with 82 additions and 15 deletions

View File

@@ -223,6 +223,19 @@ bool cChunk::CanUnload(void)
bool cChunk::CanUnloadAfterSaving(void)
{
return
m_LoadedByClient.empty() && // The chunk is not used by any client
m_IsDirty && // The chunk is dirty
(m_StayCount == 0) && // The chunk is not in a ChunkStay
(m_Presence != cpQueued) ; // The chunk is not queued for loading / generating (otherwise multi-load / multi-gen could occur)
}
void cChunk::MarkSaving(void)
{
m_IsSaving = true;