Skip to content

Commit 2f6459f

Browse files
committed
---
yaml --- r: 67196 b: refs/heads/master c: ca5ed4c h: refs/heads/master v: v3
1 parent e015495 commit 2f6459f

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 9f7e364d3a0f5d325f3722efb9c7ae4257b04e3d
2+
refs/heads/master: ca5ed4cc498ad5da22c6e1c4c0b79df07a07029e
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 18e3db7392d2d0697b7e27d6d986139960144d85
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9

trunk/src/libstd/ops.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,28 @@ pub trait Shr<RHS,Result> {
8181
pub trait Index<Index,Result> {
8282
fn index(&self, index: &Index) -> Result;
8383
}
84+
85+
#[cfg(test)]
86+
mod bench {
87+
88+
use extra::test::BenchHarness;
89+
use ops::Drop;
90+
91+
// Overhead of dtors
92+
93+
struct HasDtor {
94+
x: int
95+
}
96+
97+
impl Drop for HasDtor {
98+
fn drop(&self) {
99+
}
100+
}
101+
102+
#[bench]
103+
fn alloc_obj_with_dtor(bh: &mut BenchHarness) {
104+
do bh.iter {
105+
HasDtor { x : 10 };
106+
}
107+
}
108+
}

0 commit comments

Comments
 (0)