File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ default = ["cpp"]
1414flamegraph = [" inferno" ]
1515protobuf = [" prost" , " prost-derive" , " prost-build" ]
1616cpp = [" symbolic-demangle/cpp" ]
17+ heap = []
1718
1819[dependencies ]
1920backtrace = " 0.3"
@@ -55,7 +56,7 @@ required-features = ["flamegraph"]
5556
5657[[example ]]
5758name = " heap_profiler"
58- required-features = [" protobuf" , " flamegraph" ]
59+ required-features = [" protobuf" , " flamegraph" , " heap " ]
5960
6061[[bench ]]
6162name = " collector"
Original file line number Diff line number Diff line change 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.
2727pub const MAX_DEPTH : usize = 32 ;
@@ -32,15 +32,20 @@ pub const MAX_THREAD_NAME: usize = 16;
3232mod collector;
3333mod error;
3434mod frames;
35+ #[ cfg( feature = "heap" ) ]
3536mod heap_profiler;
37+
3638mod profiler;
3739mod report;
3840mod timer;
3941
4042pub use self :: collector:: { Collector , StackHashCounter } ;
4143pub use self :: error:: { Error , Result } ;
4244pub use self :: frames:: { Frames , Symbol } ;
45+
46+ #[ cfg( feature = "heap" ) ]
4347pub use self :: heap_profiler:: { AllocRecorder , HeapProfilerGuard } ;
48+
4449pub use self :: profiler:: ProfilerGuard ;
4550pub use self :: report:: { Report , ReportBuilder } ;
4651
You can’t perform that action at this time.
0 commit comments