Skip to content

Commit

Permalink
Disable background_threads support on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
roblabla committed Aug 4, 2024
1 parent c20fc53 commit 85913f9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
include:
- name: x86_64-pc-windows-msvc
target: x86_64-pc-windows-msvc
nobgt: 0
nobgt: 1
no_tests: 1
tag: windows-latest
- name: x86_64-apple-darwin
Expand Down
6 changes: 3 additions & 3 deletions jemalloc-ctl/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ macro_rules! r {
match stringify!($id) {
"background_thread" |
"max_background_threads"
if cfg!(target_os = "macos") => return,
if cfg!(target_os = "macos") || cfg!(windows) => return,
_ => (),
}

Expand Down Expand Up @@ -117,7 +117,7 @@ macro_rules! w {
match stringify!($id) {
"background_thread" |
"max_background_threads"
if cfg!(target_os = "macos") => return,
if cfg!(target_os = "macos") || cfg!(windows) => return,
_ => (),
}

Expand Down Expand Up @@ -167,7 +167,7 @@ macro_rules! u {
match stringify!($id) {
"background_thread" |
"max_background_threads"
if cfg!(target_os = "macos") => return,
if cfg!(target_os = "macos") || cfg!(windows) => return,
_ => (),
}

Expand Down
2 changes: 1 addition & 1 deletion jemalloc-sys/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub static UNSUPPORTED_TARGETS: &[&str] = &[
pub static UNTESTED_TARGETS: &[&str] = &["openbsd", "msvc"];

/// `jemalloc`'s background_thread support is known not to work on these targets:
pub static NO_BG_THREAD_TARGETS: &[&str] = &["musl"];
pub static NO_BG_THREAD_TARGETS: &[&str] = &["musl", "windows"];

/// targets that don't support unprefixed `malloc`
// “it was found that the `realpath` function in libc would allocate with libc malloc
Expand Down
2 changes: 1 addition & 1 deletion jemallocator/tests/background_thread_enabled.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//! library was compiled with background thread run-time support.
#![cfg(feature = "background_threads_runtime_support")]
#![cfg(not(feature = "unprefixed_malloc_on_supported_platforms"))]
#![cfg(not(target_env = "musl"))]
#![cfg(not(any(windows, target_env = "musl")))]

use tikv_jemallocator::Jemalloc;

Expand Down

0 comments on commit 85913f9

Please sign in to comment.