| ff0af1ee unknown |
1 |
|
| fce44ae9 Andy McCall ↶ |
2 |
|
| 3 |
|
| 4 |
|
| 1983686f Andy McCall ↶ |
5 |
|
| fce44ae9 Andy McCall ↶ |
6 |
mod cli; |
| 1983686f Andy McCall ↶ |
7 |
|
| d443639b Andy McCall ↶ |
8 |
#[cfg(feature = "alloc-stats")] |
| 9 |
#[global_allocator] |
| 10 |
static ALLOC: oxy_core::alloc_stats::Counting = oxy_core::alloc_stats::Counting; |
| 11 |
|
| ff0af1ee unknown |
12 |
fn main() { |
| 5b1114a0 Andy McCall ↶ |
13 |
|
| 14 |
|
| 15 |
#[cfg(unix)] |
| 16 |
unsafe { |
| 17 |
libc::signal(libc::SIGPIPE, libc::SIG_DFL); |
| 18 |
} |
| 19527875 Andy McCall ↶ |
19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
#[cfg(all(target_os = "linux", target_env = "gnu"))] |
| 24 |
if std::env::var_os("MALLOC_ARENA_MAX").is_none() { |
| 25 |
unsafe { |
| 26 |
libc::mallopt(libc::M_ARENA_MAX, 2); |
| 27 |
} |
| 28 |
} |
| d443639b Andy McCall ↶ |
29 |
let result = cli::run(); |
| 30 |
oxy_core::timing::memory_summary(); |
| 31 |
match result { |
| ff0af1ee unknown |
32 |
Ok(code) => std::process::exit(code), |
| 33 |
Err(e) => { |
| 135212de Andy McCall ↶ |
34 |
cli::ui::init(false); |
| 35 |
eprintln!("{} {e:#}", cli::ui::err("error:")); |
| ff0af1ee unknown |
36 |
std::process::exit(1); |
| 37 |
} |
| 38 |
} |
| 39 |
} |