From 2420557085ecd34a330b786437c296121bcfc4a0 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Wed, 28 Sep 2022 01:19:00 +0200 Subject: [PATCH] DocCache: Unbreak on !Linux platforms (#9566) Regression since #9529 Fix #9565 --- frontend/document/doccache.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/document/doccache.lua b/frontend/document/doccache.lua index 0cc7c2be8..95b9961b6 100644 --- a/frontend/document/doccache.lua +++ b/frontend/document/doccache.lua @@ -15,7 +15,8 @@ local DHINTCOUNT = G_defaults:readSetting("DHINTCOUNT") local function calcCacheMemSize() local min = G_defaults:readSetting("DGLOBAL_CACHE_SIZE_MINIMUM") local max = G_defaults:readSetting("DGLOBAL_CACHE_SIZE_MAXIMUM") - local calc = util.calcFreeMem() * (G_defaults:readSetting("DGLOBAL_CACHE_FREE_PROPORTION") or 0) + local memfree, _ = util.calcFreeMem() or 0, 0 + local calc = memfree * G_defaults:readSetting("DGLOBAL_CACHE_FREE_PROPORTION") return math.min(max, math.max(min, calc)) end local doccache_size = calcCacheMemSize()