Navigation Menu

Skip to content

Commit

Permalink
Fix build on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
UK992 authored and larsbergstrom committed Mar 3, 2016
1 parent 5a7ca34 commit 5d24f7c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions components/profile/lib.rs
Expand Up @@ -8,6 +8,7 @@
#![feature(plugin)]
#![plugin(plugins)]

#[cfg(not(target_os = "windows"))]
extern crate alloc_jemalloc;
extern crate hbs_pow;
extern crate ipc_channel;
Expand Down
6 changes: 6 additions & 0 deletions components/profile/mem.rs
Expand Up @@ -463,6 +463,7 @@ mod system_reporter {
newp: *mut c_void, newlen: size_t) -> c_int;
}

#[cfg(not(target_os = "windows"))]
fn jemalloc_stat(value_name: &str) -> Option<usize> {
// Before we request the measurement of interest, we first send an "epoch"
// request. Without that jemalloc gives cached statistics(!) which can be
Expand Down Expand Up @@ -498,6 +499,11 @@ mod system_reporter {
Some(value as usize)
}

#[cfg(target_os = "windows")]
fn jemalloc_stat(value_name: &str) -> Option<usize> {
None
}

// Like std::macros::try!, but for Option<>.
macro_rules! option_try(
($e:expr) => (match $e { Some(e) => e, None => return None })
Expand Down

0 comments on commit 5d24f7c

Please sign in to comment.