Files
cursor-byok/apps/desktop/src-tauri/src/lib.rs
T
Linanwanttodo 147d13f04e perf(desktop): switch to the mimalloc global allocator
glibc keeps freed pages in its arena, so RSS did not fall back after
the webview was destroyed. mimalloc returns freed memory to the OS,
letting the resident footprint settle right after the UI closes.
2026-09-02 18:20:33 +08:00

20 lines
499 B
Rust

mod desktop;
#[cfg(not(dev))]
mod frontend;
mod resource_limits;
mod startup;
mod tray;
mod update;
// mimalloc 在释放时主动向操作系统归还内存,避免 glibc 保留页导致
// 关闭窗口后 RSS 无法回落到静默启动水平。
#[global_allocator]
static GLOBAL_ALLOCATOR: mimalloc::MiMalloc = mimalloc::MiMalloc;
pub fn run() -> std::process::ExitCode {
if let Some(exit_code) = update::run_replacement_if_requested() {
return exit_code;
}
desktop::run()
}