Skip to content

Commit

Permalink
Merge pull request #1432 from hermit-os/ci-memory
Browse files Browse the repository at this point in the history
xtask(qemu): simplify memory calculation
  • Loading branch information
mkroening authored Oct 28, 2024
2 parents e9a55dc + 7e9aed6 commit efd26bb
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 efd26bb

Please sign in to comment.