1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#[cfg(any(
not(any(feature = "benchmark_memory", feature = "rust_global_allocator")),
all(feature = "benchmark_memory", feature = "rust_global_allocator"),
))]
mod default {
#[macro_export]
macro_rules! static_setup {
() => {};
}
#[macro_export]
macro_rules! main_setup {
() => {};
}
}
#[cfg(all(feature = "benchmark_memory", not(feature = "rust_global_allocator")))]
pub mod benchmark_memory {
pub use dhat;
#[macro_export]
macro_rules! static_setup {
() => {
use $crate::benchmark_memory::dhat::{Dhat, DhatAlloc};
#[global_allocator]
static ALLOCATOR: DhatAlloc = DhatAlloc;
};
}
#[macro_export]
macro_rules! main_setup {
() => {
let _dhat = Dhat::start_heap_profiling();
eprintln!("Feature");
};
}
}
#[cfg(all(feature = "rust_global_allocator", not(feature = "benchmark_memory")))]
pub mod rust_global_allocator {
pub use dlmalloc;
#[macro_export]
macro_rules! static_setup {
() => {
use $crate::rust_global_allocator::dlmalloc::GlobalDlmalloc;
#[global_allocator]
static ALLOCATOR: GlobalDlmalloc = GlobalDlmalloc;
};
}
#[macro_export]
macro_rules! main_setup {
() => {};
}
}