Skip to content

Commit 29852fb

Browse files
committed
support stable rust
Signed-off-by: Yang Keao <[email protected]>
1 parent 6e662ed commit 29852fb

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ default = ["cpp"]
1414
flamegraph = ["inferno"]
1515
protobuf = ["prost", "prost-derive", "prost-build"]
1616
cpp = ["symbolic-demangle/cpp"]
17+
heap = []
1718

1819
[dependencies]
1920
backtrace = "0.3"
@@ -55,7 +56,7 @@ required-features = ["flamegraph"]
5556

5657
[[example]]
5758
name = "heap_profiler"
58-
required-features = ["protobuf", "flamegraph"]
59+
required-features = ["protobuf", "flamegraph", "heap"]
5960

6061
[[bench]]
6162
name = "collector"

src/lib.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
//!};
2222
//! ```
2323
24-
#![feature(const_fn)]
24+
#![cfg_attr(feature = "heap", feature(const_fn))]
2525

2626
/// Define the MAX supported stack depth. TODO: make this variable mutable.
2727
pub const MAX_DEPTH: usize = 32;
@@ -32,15 +32,20 @@ pub const MAX_THREAD_NAME: usize = 16;
3232
mod collector;
3333
mod error;
3434
mod frames;
35+
#[cfg(feature = "heap")]
3536
mod heap_profiler;
37+
3638
mod profiler;
3739
mod report;
3840
mod timer;
3941

4042
pub use self::collector::{Collector, StackHashCounter};
4143
pub use self::error::{Error, Result};
4244
pub use self::frames::{Frames, Symbol};
45+
46+
#[cfg(feature = "heap")]
4347
pub use self::heap_profiler::{AllocRecorder, HeapProfilerGuard};
48+
4449
pub use self::profiler::ProfilerGuard;
4550
pub use self::report::{Report, ReportBuilder};
4651

0 commit comments

Comments
 (0)