mirror of
https://wget.la/https://github.com/leookun/cursor-byok
synced 2026-10-04 02:52:55 +08:00
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.
20 lines
499 B
Rust
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()
|
|
}
|