Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/CODE_QUALITY_TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ Generated from `docs/CODE_QUALITY_AUDIT_2026-04-18.md`. This section enumerates
- [ ] Remove or justify suppressions in `src/agent/turn_loops.rs` (unused_variables)
- [ ] Remove or justify suppressions in `src/auth/mod.rs` (unused_mut)
- [x] Remove or justify suppressions in `src/cli/dispatch.rs` (deprecated, unused_mut, unused_mut)
- [ ] Remove or justify suppressions in `src/main.rs` (non_upper_case_globals, non_upper_case_globals)
- [x] Remove or justify suppressions in `src/main.rs` (non_upper_case_globals, non_upper_case_globals)
- [ ] Remove or justify suppressions in `src/perf.rs` (non_snake_case)
- [ ] Remove or justify suppressions in `src/server.rs` (unused_mut, unused_mut)
- [ ] Remove or justify suppressions in `src/server/client_actions.rs` (clippy::too_many_arguments)
Expand Down
8 changes: 6 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,18 @@ static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
// prof:true — enable profiling support in jemalloc-prof builds
// prof_active:false — keep sampling disabled until explicitly enabled at runtime
#[cfg(all(feature = "jemalloc", not(feature = "jemalloc-prof")))]
// jemalloc reads this exact exported symbol name at startup.
// jemalloc locates its configuration by looking up the exported C symbol `malloc_conf`
// at process startup. The symbol name is defined by the jemalloc ABI and must be exactly
// `malloc_conf` (lower_snake_case). `#[allow(non_upper_case_globals)]` is therefore
// load-bearing and cannot be removed.
#[allow(non_upper_case_globals)]
#[unsafe(no_mangle)]
pub static malloc_conf: Option<&'static [u8; 50]> =
Some(b"dirty_decay_ms:1000,muzzy_decay_ms:1000,narenas:4\0");

#[cfg(feature = "jemalloc-prof")]
// jemalloc reads this exact exported symbol name at startup.
// Same as above: `malloc_conf` is an ABI-defined symbol name required by jemalloc.
// `#[allow(non_upper_case_globals)]` is load-bearing and cannot be removed.
#[allow(non_upper_case_globals)]
#[unsafe(no_mangle)]
pub static malloc_conf: Option<&'static [u8; 78]> =
Expand Down