File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -101,3 +101,22 @@ pub unsafe fn exchange_free_(ptr: *c_char) {
101
101
pub unsafe fn exchange_free ( ptr : * c_char ) {
102
102
free ( ptr as * c_void ) ;
103
103
}
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
+ }
Original file line number Diff line number Diff line change @@ -135,3 +135,22 @@ extern {
135
135
fn rust_boxed_region_free ( region : * BoxedRegion , box : * OpaqueBox ) ;
136
136
fn rust_current_boxed_region ( ) -> * BoxedRegion ;
137
137
}
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
+ }
You can’t perform that action at this time.
0 commit comments