diff --git a/host/src/lib.rs b/host/src/lib.rs index 8d30f9228..c962a25ba 100644 --- a/host/src/lib.rs +++ b/host/src/lib.rs @@ -20,9 +20,6 @@ pub mod metrics; pub mod proof; pub mod server; -#[global_allocator] -static ALLOCATOR: Cap = Cap::new(alloc::System, usize::MAX); - #[derive(Default, Clone, Serialize, Deserialize, Debug, Parser)] #[command( name = "raiko", @@ -182,6 +179,9 @@ impl ProverState { } } +#[global_allocator] +static ALLOCATOR: Cap = Cap::new(alloc::System, usize::MAX); + mod memory { use tracing::debug; @@ -197,10 +197,8 @@ mod memory { pub(crate) fn print_stats(title: &str) { let max_memory = get_max_allocated(); - debug!( - "{title}{}.{:06} MB", - max_memory / 1_000_000, - max_memory % 1_000_000 - ); + let mbs = max_memory / 1_000_000; + let kbs = max_memory % 1_000_000; + debug!("{title}{mbs}.{kbs:06} MB"); } }