Skip to content

docs(main): justify non_upper_case_globals on jemalloc malloc_conf (#101)#177

Merged
quangdang46 merged 2 commits into
masterfrom
docs/main-malloc-conf-justification
May 22, 2026
Merged

docs(main): justify non_upper_case_globals on jemalloc malloc_conf (#101)#177
quangdang46 merged 2 commits into
masterfrom
docs/main-malloc-conf-justification

Conversation

@quangdang46
Copy link
Copy Markdown
Owner

What

The two #[allow(non_upper_case_globals)] suppressions in src/main.rs guard a load-bearing ABI symbol: jemalloc looks up the exported C symbol malloc_conf at process startup, and the name must be exactly that (lower_snake_case). Renaming to satisfy the lint would silently disable jemalloc tuning.

This addresses issue #101: #101

Changes

  • src/main.rs: replace the terse // jemalloc reads this exact exported symbol name at startup. comment with a concrete explanation referencing the ABI contract on both malloc_conf definitions (with and without jemalloc-prof).
  • docs/CODE_QUALITY_TODO.md: tick the matching item.

Tests

cargo fmt --check clean; comment-only change to a static, no behavior change.

Notes

Ports upstream PR 1jehuang#123.

The two #[allow(non_upper_case_globals)] suppressions in src/main.rs
guard a load-bearing ABI symbol: jemalloc looks up the exported C
symbol `malloc_conf` at process startup, and the name must be exactly
that (lower_snake_case). Renaming to satisfy the lint would silently
disable jemalloc tuning.

Replace the terse comment with a concrete explanation noting the ABI
contract so future contributors don't try to remove the allow.

Tick the matching item in docs/CODE_QUALITY_TODO.md.

Ports upstream PR 1jehuang#123.
Closes #101
@quangdang46 quangdang46 merged commit 69cf18c into master May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant