sculpt: upper limit for automatic quota upgrading

This commit is contained in:
Norman Feske 2024-03-19 15:04:18 +01:00 committed by Christian Helmuth
parent e53b00aafb
commit 06c4b0248b
2 changed files with 4 additions and 4 deletions

View File

@ -202,12 +202,12 @@ class Dialog::Distant_runtime::View : private Views::Element
return false; return false;
if (child.has_sub_node("ram") && child.sub_node("ram").has_attribute("requested")) { if (child.has_sub_node("ram") && child.sub_node("ram").has_attribute("requested")) {
_ram.value *= 2; _ram.value = min(2*_ram.value, 32*1024*1024u);
result = true; result = true;
} }
if (child.has_sub_node("caps") && child.sub_node("caps").has_attribute("requested")) { if (child.has_sub_node("caps") && child.sub_node("caps").has_attribute("requested")) {
_caps.value += 100; _caps.value = min(_caps.value + 100, 2000u);
result = true; result = true;
} }

View File

@ -106,12 +106,12 @@ struct Sculpt::Child_state : Noncopyable
return false; return false;
if (child.has_sub_node("ram") && child.sub_node("ram").has_attribute("requested")) { if (child.has_sub_node("ram") && child.sub_node("ram").has_attribute("requested")) {
_ram_quota.value *= 2; _ram_quota.value = min(_ram_quota.value*2, 256*1024*1024u);
result = true; result = true;
} }
if (child.has_sub_node("caps") && child.sub_node("caps").has_attribute("requested")) { if (child.has_sub_node("caps") && child.sub_node("caps").has_attribute("requested")) {
_cap_quota.value += 100; _cap_quota.value = min(_cap_quota.value + 100, 5000u);
result = true; result = true;
} }