Skip to content

Commit 85913f9

Browse files
committed
Disable background_threads support on windows
1 parent c20fc53 commit 85913f9

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

.github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
include:
2020
- name: x86_64-pc-windows-msvc
2121
target: x86_64-pc-windows-msvc
22-
nobgt: 0
22+
nobgt: 1
2323
no_tests: 1
2424
tag: windows-latest
2525
- name: x86_64-apple-darwin

jemalloc-ctl/src/macros.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ macro_rules! r {
6969
match stringify!($id) {
7070
"background_thread" |
7171
"max_background_threads"
72-
if cfg!(target_os = "macos") => return,
72+
if cfg!(target_os = "macos") || cfg!(windows) => return,
7373
_ => (),
7474
}
7575

@@ -117,7 +117,7 @@ macro_rules! w {
117117
match stringify!($id) {
118118
"background_thread" |
119119
"max_background_threads"
120-
if cfg!(target_os = "macos") => return,
120+
if cfg!(target_os = "macos") || cfg!(windows) => return,
121121
_ => (),
122122
}
123123

@@ -167,7 +167,7 @@ macro_rules! u {
167167
match stringify!($id) {
168168
"background_thread" |
169169
"max_background_threads"
170-
if cfg!(target_os = "macos") => return,
170+
if cfg!(target_os = "macos") || cfg!(windows) => return,
171171
_ => (),
172172
}
173173

jemalloc-sys/src/env.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub static UNSUPPORTED_TARGETS: &[&str] = &[
1212
pub static UNTESTED_TARGETS: &[&str] = &["openbsd", "msvc"];
1313

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

1717
/// targets that don't support unprefixed `malloc`
1818
// “it was found that the `realpath` function in libc would allocate with libc malloc

jemallocator/tests/background_thread_enabled.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//! library was compiled with background thread run-time support.
33
#![cfg(feature = "background_threads_runtime_support")]
44
#![cfg(not(feature = "unprefixed_malloc_on_supported_platforms"))]
5-
#![cfg(not(target_env = "musl"))]
5+
#![cfg(not(any(windows, target_env = "musl")))]
66

77
use tikv_jemallocator::Jemalloc;
88

0 commit comments

Comments
 (0)