cosmic-files/src/main.rs

17 lines
436 B
Rust
Raw Normal View History

#[cfg(feature = "jemalloc")]
use tikv_jemallocator::Jemalloc;
#[cfg(feature = "jemalloc")]
#[global_allocator]
static GLOBAL: Jemalloc = Jemalloc;
2024-01-03 15:27:32 -07:00
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Prevents glibc from hoarding memory via memory fragmentation.
#[cfg(all(not(feature = "jemalloc"), target_env = "gnu"))]
unsafe {
libc::mallopt(libc::M_MMAP_THRESHOLD, 65536);
}
2024-02-01 15:14:14 -07:00
cosmic_files::main()
}