From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- library/core/benches/ops.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 library/core/benches/ops.rs (limited to 'library/core/benches/ops.rs') 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 }; + }) +} -- cgit v1.2.3