mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-29 10:25:36 -04:00
Memory: clean up interface used to get memory (RAM) size
This commit is contained in:
parent
0c129f2460
commit
9693d7a5bd
4 changed files with 38 additions and 32 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue