diff options
Diffstat (limited to 'library/core/benches/ops.rs')
-rw-r--r-- | library/core/benches/ops.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/library/core/benches/ops.rs b/library/core/benches/ops.rs new file mode 100644 index 000000000..0a2be8a28 --- /dev/null +++ b/library/core/benches/ops.rs @@ -0,0 +1,19 @@ +use core::ops::*; +use test::Bencher; + +// Overhead of dtors + +struct HasDtor { + _x: isize, +} + +impl Drop for HasDtor { + fn drop(&mut self) {} +} + +#[bench] +fn alloc_obj_with_dtor(b: &mut Bencher) { + b.iter(|| { + HasDtor { _x: 10 }; + }) +} |