2024-11-15 11:10:30 -07:00
|
|
|
#[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>> {
|
2025-02-05 12:51:18 +01:00
|
|
|
// 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()
|
2024-02-01 16:29:10 +00:00
|
|
|
}
|