about summary refs log tree commit diff
path: root/library/core/benches/ops.rs
diff options
context:
space:
mode:
authormark <markm@cs.wisc.edu>2020-06-11 21:31:49 -0500
committermark <markm@cs.wisc.edu>2020-07-27 19:51:13 -0500
commit2c31b45ae878b821975c4ebd94cc1e49f6073fd0 (patch)
tree14f64e683e3f64dcbcfb8c2c7cb45ac7592e6e09 /library/core/benches/ops.rs
parent9be8ffcb0206fc1558069a7b4766090df7877659 (diff)
downloadrust-2c31b45ae878b821975c4ebd94cc1e49f6073fd0.tar.gz
rust-2c31b45ae878b821975c4ebd94cc1e49f6073fd0.zip
mv std libs to library/
Diffstat (limited to 'library/core/benches/ops.rs')
-rw-r--r--library/core/benches/ops.rs19
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 00000000000..0a2be8a2881
--- /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 };
+    })
+}