Skip to content

Commit

Permalink
xtask(qemu): simplify memory calculation
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Kröning <[email protected]>
  • Loading branch information
mkroening committed Oct 28, 2024
1 parent 2060d1d commit 7e9aed6
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions xtask/src/ci/qemu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,22 +218,17 @@ impl Qemu {
}

fn memory(&self) -> usize {
let mut memory = 32usize;
if self.build.cargo_build.artifact.arch == Arch::Riscv64 {
memory *= 4;
}
if self.build.cargo_build.artifact.profile() == "dev" {
memory *= 16;
}
memory *= self.smp;
if self.netdev.is_some() {
memory = memory.max(1024);
}
if self.build.cargo_build.artifact.arch == Arch::Aarch64 {
memory = memory.max(256);
if self.build.cargo_build.artifact.profile() == "release"
&& self.build.package == "hello_world"
{
return match self.build.cargo_build.artifact.arch {
Arch::X86_64 => 32,
Arch::Aarch64 => 144,
Arch::Riscv64 => 40,
};
}
memory = memory.max(64);
memory

1024
}

fn memory_args(&self) -> [String; 2] {
Expand Down

0 comments on commit 7e9aed6

Please sign in to comment.