From 5d24f7c6b7fd4b9d6402a4287377402b40adbad1 Mon Sep 17 00:00:00 2001 From: UK992 Date: Tue, 1 Mar 2016 15:09:15 +0100 Subject: [PATCH] Fix build on Windows --- components/profile/lib.rs | 1 + components/profile/mem.rs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/components/profile/lib.rs b/components/profile/lib.rs index fa93f883b7e..b6fa7e57a34 100644 --- a/components/profile/lib.rs +++ b/components/profile/lib.rs @@ -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; diff --git a/components/profile/mem.rs b/components/profile/mem.rs index 4094a4717d3..398bcab438d 100644 --- a/components/profile/mem.rs +++ b/components/profile/mem.rs @@ -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 { // Before we request the measurement of interest, we first send an "epoch" // request. Without that jemalloc gives cached statistics(!) which can be @@ -498,6 +499,11 @@ mod system_reporter { Some(value as usize) } + #[cfg(target_os = "windows")] + fn jemalloc_stat(value_name: &str) -> Option { + None + } + // Like std::macros::try!, but for Option<>. macro_rules! option_try( ($e:expr) => (match $e { Some(e) => e, None => return None })