#[cfg(all(feature = "mimalloc-allocator", not(feature = "rusty-alloc")))]
#[global_allocator]
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
#[cfg(all(
target_os = "macos",
feature = "mimalloc-allocator",
not(feature = "rusty-alloc")
))]
#[used]
#[unsafe(link_section = "__DATA,__mod_init_func")]
static MIMALLOC_RETAG: extern "C" fn() = {
extern "C" fn retag_mimalloc_heap() {
unsafe extern "C" {
fn mi_option_set(option: std::ffi::c_int, value: std::ffi::c_long);
}
const MI_OPTION_OS_TAG: std::ffi::c_int = 18;
if std::env::var_os("MIMALLOC_OS_TAG").is_none() {
unsafe { mi_option_set(MI_OPTION_OS_TAG, 254) };
}
}
retag_mimalloc_heap
};
#[cfg(feature = "rusty-alloc")]
#[global_allocator]
static GLOBAL: rusty_alloc_api::RustyAlloc = rusty_alloc_api::RustyAlloc;
fn main() -> std::process::ExitCode {
#[cfg(unix)]
unsafe {
libc::signal(libc::SIGPIPE, libc::SIG_DFL);
}
codewhale_cli::run_cli()
}