cosmic-files/src/main.rs
2025-02-05 12:51:18 +01:00

16 lines
436 B
Rust

#[cfg(feature = "jemalloc")]
use tikv_jemallocator::Jemalloc;
#[cfg(feature = "jemalloc")]
#[global_allocator]
static GLOBAL: Jemalloc = Jemalloc;
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);
}
cosmic_files::main()
}