Skip to content

Commit

Permalink
lbf mimalloc moved from lib.rs to main.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
JeroenGar committed Mar 15, 2024
1 parent 5021c65 commit 17aa496
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 0 additions & 4 deletions lbf/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::time::Instant;

use mimalloc::MiMalloc;
use once_cell::sync::Lazy;

pub mod io;
Expand All @@ -9,7 +8,4 @@ pub mod lbf_cost;
pub mod lbf_optimizer;
pub mod samplers;

#[global_allocator]
static GLOBAL: MiMalloc = MiMalloc; //more efficient allocator

pub static EPOCH: Lazy<Instant> = Lazy::new(Instant::now);
3 changes: 3 additions & 0 deletions lbf/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use std::path::Path;

use clap::Parser as ClapParser;
use log::{error, warn};
use mimalloc::MiMalloc;
use rand::prelude::SmallRng;
use rand::SeedableRng;

Expand All @@ -18,6 +19,8 @@ use lbf::lbf_config::LBFConfig;
use lbf::lbf_optimizer::LBFOptimizer;
use lbf::{io, EPOCH};

#[global_allocator]
static GLOBAL: MiMalloc = MiMalloc; //more efficient allocator
fn main() {
let args = Cli::parse();
io::init_logger(args.log_level);
Expand Down

0 comments on commit 17aa496

Please sign in to comment.