#[cfg(unix)]
#[global_allocator]
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
use std::process::ExitCode;
#[cfg(windows)]
fn main() -> ExitCode {
match std::thread::Builder::new()
.name("zccache-cli".to_string())
.stack_size(8 * 1024 * 1024)
.spawn(run_main)
{
Ok(handle) => match handle.join() {
Ok(code) => code,
Err(_) => ExitCode::FAILURE,
},
Err(err) => {
eprintln!("zccache: failed to start CLI thread: {err}");
ExitCode::FAILURE
}
}
}
#[cfg(not(windows))]
fn main() -> ExitCode {
run_main()
}
fn run_main() -> ExitCode {
let _crash_guard = zccache::core::crash::install("zccache");
zccache::core::crash::note_previous_crashes();
zccache::cli::commands::run()
}