Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix windows support #99

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
6 changes: 6 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ jobs:
strategy:
matrix:
include:
- name: x86_64-pc-windows-msvc
target: x86_64-pc-windows-msvc
nobgt: 1
no_tests: 1
tag: windows-latest
- name: x86_64-apple-darwin
target: x86_64-apple-darwin
nobgt: 0
Expand Down Expand Up @@ -59,6 +64,7 @@ jobs:
with:
submodules: true
- name: install
shell: bash
run: |
if [[ "${{ matrix.rust }}" == "nightly" ]]; then
rustup default nightly
Expand Down
4 changes: 2 additions & 2 deletions jemalloc-ctl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ option! {
/// # static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
/// #
/// # fn main() {
/// # #[cfg(not(target_os = "macos"))] {
/// # #[cfg(not(any(target_os = "macos", windows)))] {
/// #
/// use tikv_jemalloc_ctl::background_thread;
/// let bg = background_thread::mib().unwrap();
Expand Down Expand Up @@ -171,7 +171,7 @@ option! {
/// # static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
/// #
/// # fn main() {
/// # #[cfg(not(target_os = "macos"))] {
/// # #[cfg(not(any(target_os = "macos", windows)))] {
/// #
/// use tikv_jemalloc_ctl::max_background_threads;
/// let m = max_background_threads::mib().unwrap();
Expand Down
12 changes: 9 additions & 3 deletions jemalloc-ctl/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,13 @@ macro_rules! r {
match stringify!($id) {
"background_thread" |
"max_background_threads"
if cfg!(target_os = "macos") => return,
if cfg!(any(target_os = "macos", windows)) => return,
"lg_prof_interval" |
"lg_prof_sample" |
"prof_final" |
"prof_leak" |
"prof"
if cfg!(windows) => return,
_ => (),
}

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

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

Expand Down
20 changes: 20 additions & 0 deletions jemalloc-ctl/src/profiling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ option! {
/// # static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
/// #
/// # fn main() {
/// # #[cfg(not(windows))] {
/// #
/// use tikv_jemalloc_ctl::profiling;
/// let lg_prof_interval = profiling::lg_prof_interval::read().unwrap();
/// println!("average interval between memory profile dumps: {}", lg_prof_interval);
/// #
/// # } // #[cfg(..)]
/// # }
/// ```
mib_docs: /// See [`lg_prof_interval`].
Expand All @@ -49,9 +53,13 @@ option! {
/// # static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
/// #
/// # fn main() {
/// # #[cfg(not(windows))] {
/// #
/// use tikv_jemalloc_ctl::profiling;
/// let lg_prof_sample = profiling::lg_prof_sample::read().unwrap();
/// println!("average interval between allocation samples: {}", lg_prof_sample);
/// #
/// # } // #[cfg(..)]
/// # }
/// ```
mib_docs: /// See [`lg_prof_sample`].
Expand Down Expand Up @@ -79,9 +87,13 @@ option! {
/// # static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
/// #
/// # fn main() {
/// # #[cfg(not(windows))] {
/// #
/// use tikv_jemalloc_ctl::profiling;
/// let prof_final = profiling::prof_final::read().unwrap();
/// println!("dump final memory usage to file: {}", prof_final);
/// #
/// # } // #[cfg(..)]
/// # }
/// ```
mib_docs: /// See [`prof_final`].
Expand Down Expand Up @@ -116,9 +128,13 @@ option! {
/// # static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
/// #
/// # fn main() {
/// # #[cfg(not(windows))] {
/// #
/// use tikv_jemalloc_ctl::profiling;
/// let prof = profiling::prof::read().unwrap();
/// println!("is memory profiling enabled: {}", prof);
/// #
/// # } // #[cfg(..)]
/// # }
/// ```
mib_docs: /// See [`prof`].
Expand Down Expand Up @@ -146,9 +162,13 @@ option! {
/// # static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
/// #
/// # fn main() {
/// # #[cfg(not(windows))] {
/// #
/// use tikv_jemalloc_ctl::profiling;
/// let prof_leak = profiling::prof_leak::read().unwrap();
/// println!("is leak reporting enabled: {}", prof_leak);
/// #
/// # } // #[cfg(..)]
/// # }
/// ```
mib_docs: /// See [`prof_leak`].
Expand Down
Loading
Loading