Skip to content

Commit b17b282

Browse files
jqnatividadclaude
andcommitted
address review: use jemallocator feature name and mutually exclusive cfg guards
- Switch all cfg guards from feature = "tikv-jemallocator" to feature = "jemallocator" (the public crate feature name) - Make allocator cfg guards mutually exclusive with not() clauses so only compile_error! fires when both features are enabled - Clarify env vars docs that allocator-specific vars are build-dependent - Fix Polars badge markdown line break in README.md Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 92ee762 commit b17b282

6 files changed

Lines changed: 15 additions & 16 deletions

File tree

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@
105105
🧠: expensive operations are memoized with available inter-session Redis/Disk caching for fetch commands.
106106
🗄️: [Extended input support](#extended-input-support).
107107
🗃️: [Limited Extended input support](#limited-extended-input-support).
108-
🐻‍❄️: command powered/accelerated by [![polars 0.53.0:py_1.39.3:bb93ba8](https://img.shields.io/badge/polars-0.53.0:py_1.39.3_bb93ba8-blue?logo=polars
109-
)](https://github.com/pola-rs/polars/releases/tag/py-1.39.3) vectorized query engine.
108+
🐻‍❄️: command powered/accelerated by [![polars 0.53.0:py_1.39.3:bb93ba8](https://img.shields.io/badge/polars-0.53.0:py_1.39.3_bb93ba8-blue?logo=polars)](https://github.com/pola-rs/polars/releases/tag/py-1.39.3) vectorized query engine.
110109
🤖: command uses Natural Language Processing or Generative AI.
111110
🏎️: multithreaded and/or faster when an index (📇) is available.
112111
🚀: multithreaded even without an index.

docs/ENVIRONMENT_VARIABLES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Several dependencies also have environment variables that influence qsv's perfor
7878
* `POLARS_BACKTRACE_IN_ERR` - if set to 1, includes backtrace in polars-related error messages.
7979

8080
> ℹ️ **NOTE:** To get a list of all active qsv-relevant environment variables, run `qsv --envlist`.
81-
Relevant env vars are defined as anything that starts with `QSV_`, `MIMALLOC_`, `JEMALLOC_`, `MALLOC_CONF` & the proxy variables listed above.
81+
Relevant env vars always include anything that starts with `QSV_`, `MALLOC_CONF` & the proxy variables listed above. Allocator-specific env vars are build-dependent: `MIMALLOC_` vars are included when qsv is built with mimalloc support, and `JEMALLOC_` vars are included when qsv is built with jemalloc support.
8282

8383
## MCP Server Environment Variables
8484

src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ use crate::{
4646
config::SPONSOR_MESSAGE,
4747
};
4848

49-
#[cfg(all(feature = "mimalloc", feature = "tikv-jemallocator"))]
49+
#[cfg(all(feature = "mimalloc", feature = "jemallocator"))]
5050
compile_error!("Features `mimalloc` and `jemallocator` are mutually exclusive. Enable only one.");
5151

52-
#[cfg(feature = "mimalloc")]
52+
#[cfg(all(feature = "mimalloc", not(feature = "jemallocator")))]
5353
#[global_allocator]
5454
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
5555

56-
#[cfg(feature = "tikv-jemallocator")]
56+
#[cfg(all(feature = "jemallocator", not(feature = "mimalloc")))]
5757
#[global_allocator]
5858
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
5959

src/maindp.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ use crate::{
4343
config::SPONSOR_MESSAGE,
4444
};
4545

46-
#[cfg(all(feature = "mimalloc", feature = "tikv-jemallocator"))]
46+
#[cfg(all(feature = "mimalloc", feature = "jemallocator"))]
4747
compile_error!("Features `mimalloc` and `jemallocator` are mutually exclusive. Enable only one.");
4848

49-
#[cfg(feature = "mimalloc")]
49+
#[cfg(all(feature = "mimalloc", not(feature = "jemallocator")))]
5050
#[global_allocator]
5151
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
5252

53-
#[cfg(feature = "tikv-jemallocator")]
53+
#[cfg(all(feature = "jemallocator", not(feature = "mimalloc")))]
5454
#[global_allocator]
5555
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
5656

src/mainlite.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ use crate::{
1010
config::SPONSOR_MESSAGE,
1111
};
1212

13-
#[cfg(all(feature = "mimalloc", feature = "tikv-jemallocator"))]
13+
#[cfg(all(feature = "mimalloc", feature = "jemallocator"))]
1414
compile_error!("Features `mimalloc` and `jemallocator` are mutually exclusive. Enable only one.");
1515

16-
#[cfg(feature = "mimalloc")]
16+
#[cfg(all(feature = "mimalloc", not(feature = "jemallocator")))]
1717
#[global_allocator]
1818
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
1919

20-
#[cfg(feature = "tikv-jemallocator")]
20+
#[cfg(all(feature = "jemallocator", not(feature = "mimalloc")))]
2121
#[global_allocator]
2222
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
2323

src/util.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -596,9 +596,9 @@ pub fn version() -> String {
596596
let mimalloc_version = mimalloc::MiMalloc.version();
597597
format!("mimalloc {mimalloc_version}")
598598
};
599-
#[cfg(feature = "tikv-jemallocator")]
599+
#[cfg(all(feature = "jemallocator", not(feature = "mimalloc")))]
600600
let malloc_kind = "jemalloc";
601-
#[cfg(not(any(feature = "mimalloc", feature = "tikv-jemallocator")))]
601+
#[cfg(not(any(feature = "mimalloc", feature = "jemallocator")))]
602602
let malloc_kind = "standard";
603603
let (qsvtype, maj, min, pat, pre, rustversion) = (
604604
option_env!("CARGO_BIN_NAME"),
@@ -658,7 +658,7 @@ pub fn show_env_vars() {
658658
env_var_set = true;
659659
woutinfo!("{env_var}: {v:?}");
660660
}
661-
#[cfg(feature = "tikv-jemallocator")]
661+
#[cfg(all(feature = "jemallocator", not(feature = "mimalloc")))]
662662
if env_var.starts_with("QSV_")
663663
|| env_var.starts_with("JEMALLOC_")
664664
|| env_var == "MALLOC_CONF"
@@ -667,7 +667,7 @@ pub fn show_env_vars() {
667667
env_var_set = true;
668668
woutinfo!("{env_var}: {v:?}");
669669
}
670-
#[cfg(not(any(feature = "mimalloc", feature = "tikv-jemallocator")))]
670+
#[cfg(not(any(feature = "mimalloc", feature = "jemallocator")))]
671671
if env_var.starts_with("QSV_")
672672
|| OTHER_ENV_VARS.contains(&env_var.to_ascii_lowercase().as_str())
673673
{

0 commit comments

Comments
 (0)