mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
fix(EnsureAvailableMemory): do not warn if available memory could not be read
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
parent
b230645d53
commit
575be16d3e
1 changed files with 5 additions and 3 deletions
|
|
@ -26,9 +26,11 @@ EnsureAvailableMemory::EnsureAvailableMemory(LaunchTask* parent, MinecraftInstan
|
|||
void EnsureAvailableMemory::executeTask()
|
||||
{
|
||||
const uint64_t available = HardwareInfo::availableRamMiB();
|
||||
const uint64_t min = m_instance->settings()->get("MinMemAlloc").toUInt();
|
||||
const uint64_t max = m_instance->settings()->get("MaxMemAlloc").toUInt();
|
||||
const uint64_t required = std::max(min, max);
|
||||
if (available == 0) {
|
||||
// could not read
|
||||
emitSucceeded();
|
||||
return;
|
||||
}
|
||||
|
||||
if (static_cast<double>(required) * 0.9 > static_cast<double>(available)) {
|
||||
bool shouldAbort = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue