Skip to content

armgit / xerj

Public Imported from GitHub
0

AI search engine and MCP server for bots and agents. One Rust binary indexes code, docs, logs, JSONL/CSV and PDFs for BM25 full-text, vector and hybrid search, code search without grep, agent memory and RAG. Elasticsearch-compatible API; Corpus Hub serves hundreds of reference memory corpora.

fix(server): cfg-gate the jemalloc purge hook for MSVC — unbreaks the Windows build

xerj-org97c45805c1e7
diff --git a/engine/crates/xerj-server/src/main.rs b/engine/crates/xerj-server/src/main.rs
index e306e871a..bfedf309e 100644
--- a/engine/crates/xerj-server/src/main.rs
+++ b/engine/crates/xerj-server/src/main.rs
@@ -2497,6 +2497,12 @@ async fn async_main() -> Result<()> {
// installed just below is what lets that drain actually lower RSS
// under jemalloc, which otherwise keeps freed pages resident.
if storage_available {
+ // The purge-hook closure calls jemalloc mallctls, and jemalloc is not
+ // built on MSVC (the tikv crates are target-gated out in Cargo.toml),
+ // so the hook installs on every other target only — the engine's
+ // default no-op purge covers MSVC. The resource sampler below still
+ // runs everywhere: allocator_snapshot() has its own msvc fallback.
+ #[cfg(not(target_env = "msvc"))]
xerj_engine::engine::set_allocator_purge_hook(std::sync::Arc::new(|| {
// Refresh the cached stats first (the epoch mallctl is what makes
// the stats reads in the ingest-memory ledger coherent), then