Memory: clean up interface used to get memory (RAM) size

This commit is contained in:
Adriaan de Groot 2017-09-20 08:22:39 -04:00
parent 0c129f2460
commit 9693d7a5bd
4 changed files with 38 additions and 32 deletions

View file

@ -310,9 +310,9 @@ RequirementsChecker::checkEnoughStorage( qint64 requiredSpace )
bool
RequirementsChecker::checkEnoughRam( qint64 requiredRam )
{
qint64 availableRam = CalamaresUtils::System::instance()->getPhysicalMemoryB();
if ( !availableRam )
availableRam = CalamaresUtils::System::instance()->getTotalMemoryB();
// Ignore the guesstimate-factor; we get an under-estimate
// which is probably the usable RAM for programs.
quint64 availableRam = CalamaresUtils::System::instance()->getTotalMemoryB().first;
return availableRam >= requiredRam * 0.95; // because MemTotal is variable
}