1#![forbid(unsafe_code)]
7#![cfg(target_os = "linux")]
8
9#[global_allocator]
12#[cfg(not(feature = "mem-profile-tracing"))]
13static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
14#[global_allocator]
15#[cfg(feature = "mem-profile-tracing")]
16static GLOBAL: dhat::Alloc = dhat::Alloc;
17
18#[cfg(target_arch = "x86_64")]
23use fast_memcpy as _;
24
25pub fn underhill_main() -> anyhow::Result<()> {
28 let argv0 = std::path::PathBuf::from(std::env::args_os().next().unwrap());
29 match argv0.file_name().unwrap().to_str().unwrap() {
30 "underhill-init" => underhill_init::main(),
31 "underhill-crash" => underhill_crash::main(),
32 "underhill-dump" => underhill_dump::main(),
33 _ => underhill_core::main(),
34 }
35}