about summary refs log tree commit diff
path: root/library/coretests/benches/ops.rs
blob: 3d0b3302957bfdd0136bd5a0e5f907e128a32c0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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 };
    })
}