fix jemalloc cfgs lacking msvc conditions
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
4add39d0fe
commit
7ce782ddf4
3 changed files with 10 additions and 7 deletions
|
@ -38,7 +38,7 @@ pub fn check(config: &Config) -> Result {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
if cfg!(all(feature = "hardened_malloc", feature = "jemalloc")) {
|
if cfg!(all(feature = "hardened_malloc", feature = "jemalloc", not(target_env = "msvc"))) {
|
||||||
debug_warn!(
|
debug_warn!(
|
||||||
"hardened_malloc and jemalloc compile-time features are both enabled, this causes \
|
"hardened_malloc and jemalloc compile-time features are both enabled, this causes \
|
||||||
jemalloc to be used."
|
jemalloc to be used."
|
||||||
|
|
|
@ -13,7 +13,7 @@ use std::{
|
||||||
use async_channel::{QueueStrategy, Receiver, RecvError, Sender};
|
use async_channel::{QueueStrategy, Receiver, RecvError, Sender};
|
||||||
use conduwuit::{
|
use conduwuit::{
|
||||||
debug, debug_warn, err, error, implement,
|
debug, debug_warn, err, error, implement,
|
||||||
result::{DebugInspect, LogDebugErr},
|
result::DebugInspect,
|
||||||
trace,
|
trace,
|
||||||
utils::sys::compute::{get_affinity, nth_core_available, set_affinity},
|
utils::sys::compute::{get_affinity, nth_core_available, set_affinity},
|
||||||
Error, Result, Server,
|
Error, Result, Server,
|
||||||
|
@ -290,9 +290,12 @@ fn worker_init(&self, id: usize) {
|
||||||
// affinity is empty (no-op) if there's only one queue
|
// affinity is empty (no-op) if there's only one queue
|
||||||
set_affinity(affinity.clone());
|
set_affinity(affinity.clone());
|
||||||
|
|
||||||
#[cfg(feature = "jemalloc")]
|
#[cfg(all(not(target_env = "msvc"), feature = "jemalloc"))]
|
||||||
if affinity.clone().count() == 1 && conduwuit::alloc::je::is_affine_arena() {
|
if affinity.clone().count() == 1 && conduwuit::alloc::je::is_affine_arena() {
|
||||||
use conduwuit::alloc::je::this_thread::{arena_id, set_arena};
|
use conduwuit::{
|
||||||
|
alloc::je::this_thread::{arena_id, set_arena},
|
||||||
|
result::LogDebugErr,
|
||||||
|
};
|
||||||
|
|
||||||
let id = affinity.clone().next().expect("at least one id");
|
let id = affinity.clone().next().expect("at least one id");
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@ fn set_worker_affinity() {
|
||||||
set_worker_mallctl(id);
|
set_worker_mallctl(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "jemalloc")]
|
#[cfg(all(not(target_env = "msvc"), feature = "jemalloc"))]
|
||||||
fn set_worker_mallctl(id: usize) {
|
fn set_worker_mallctl(id: usize) {
|
||||||
use conduwuit::alloc::je::{
|
use conduwuit::alloc::je::{
|
||||||
is_affine_arena,
|
is_affine_arena,
|
||||||
|
@ -143,7 +143,7 @@ fn set_worker_mallctl(id: usize) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(feature = "jemalloc"))]
|
#[cfg(any(not(feature = "jemalloc"), target_env = "msvc"))]
|
||||||
fn set_worker_mallctl(_: usize) {}
|
fn set_worker_mallctl(_: usize) {}
|
||||||
|
|
||||||
#[tracing::instrument(
|
#[tracing::instrument(
|
||||||
|
@ -189,7 +189,7 @@ fn thread_park() {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn gc_on_park() {
|
fn gc_on_park() {
|
||||||
#[cfg(feature = "jemalloc")]
|
#[cfg(all(not(target_env = "msvc"), feature = "jemalloc"))]
|
||||||
conduwuit::alloc::je::this_thread::decay()
|
conduwuit::alloc::je::this_thread::decay()
|
||||||
.log_debug_err()
|
.log_debug_err()
|
||||||
.ok();
|
.ok();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue