Skip to content

Commit f6b3945

Browse files
committed
---
yaml --- r: 69242 b: refs/heads/auto c: ca5ed4c h: refs/heads/master v: v3
1 parent 24b1af1 commit f6b3945

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
@@ -14,6 +14,6 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: 9f7e364d3a0f5d325f3722efb9c7ae4257b04e3d
17+
refs/heads/auto: ca5ed4cc498ad5da22c6e1c4c0b79df07a07029e
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1919
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c

branches/auto/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)