pub unsafe fn exchange_free(ptr: *c_char) {
free(ptr as *c_void);
}
+
+#[cfg(test)]
+mod bench {
+ use extra::test::BenchHarness;
+
+ #[bench]
+ fn alloc_owned_small(bh: &mut BenchHarness) {
+ do bh.iter {
+ ~10;
+ }
+ }
+
+ #[bench]
+ fn alloc_owned_big(bh: &mut BenchHarness) {
+ do bh.iter {
+ ~[10, ..1000];
+ }
+ }
+}
fn rust_boxed_region_free(region: *BoxedRegion, box: *OpaqueBox);
fn rust_current_boxed_region() -> *BoxedRegion;
}
+
+#[cfg(test)]
+mod bench {
+ use extra::test::BenchHarness;
+
+ #[bench]
+ fn alloc_managed_small(bh: &mut BenchHarness) {
+ do bh.iter {
+ @10;
+ }
+ }
+
+ #[bench]
+ fn alloc_managed_big(bh: &mut BenchHarness) {
+ do bh.iter {
+ @[10, ..1000];
+ }
+ }
+}