Skip to content

Commit 450d239

Browse files
committed
---
yaml --- r: 67193 b: refs/heads/master c: 3d5fb47 h: refs/heads/master i: 67191: 727f244 v: v3
1 parent 372a886 commit 450d239

File tree

3 files changed

+39
-1
lines changed

3 files changed

+39
-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: e5cbede103fca018089b113ec35f0cf863df7106
2+
refs/heads/master: 3d5fb470fb22dea6473fc1a4d265ce9494dd4120
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 18e3db7392d2d0697b7e27d6d986139960144d85
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9

trunk/src/libstd/rt/global_heap.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,22 @@ pub unsafe fn exchange_free_(ptr: *c_char) {
101101
pub unsafe fn exchange_free(ptr: *c_char) {
102102
free(ptr as *c_void);
103103
}
104+
105+
#[cfg(test)]
106+
mod bench {
107+
use extra::test::BenchHarness;
108+
109+
#[bench]
110+
fn alloc_owned_small(bh: &mut BenchHarness) {
111+
do bh.iter {
112+
~10;
113+
}
114+
}
115+
116+
#[bench]
117+
fn alloc_owned_big(bh: &mut BenchHarness) {
118+
do bh.iter {
119+
~[10, ..1000];
120+
}
121+
}
122+
}

trunk/src/libstd/rt/local_heap.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,22 @@ extern {
135135
fn rust_boxed_region_free(region: *BoxedRegion, box: *OpaqueBox);
136136
fn rust_current_boxed_region() -> *BoxedRegion;
137137
}
138+
139+
#[cfg(test)]
140+
mod bench {
141+
use extra::test::BenchHarness;
142+
143+
#[bench]
144+
fn alloc_managed_small(bh: &mut BenchHarness) {
145+
do bh.iter {
146+
@10;
147+
}
148+
}
149+
150+
#[bench]
151+
fn alloc_managed_big(bh: &mut BenchHarness) {
152+
do bh.iter {
153+
@[10, ..1000];
154+
}
155+
}
156+
}

0 commit comments

Comments
 (0)