@@ -115,15 +115,19 @@ unsafe fn exchange_free(ptr: *mut u8, old_size: uint, align: uint) {
115
115
// The minimum alignment guaranteed by the architecture. This value is used to
116
116
// add fast paths for low alignment values. In practice, the alignment is a
117
117
// constant at the call site and the branch will be optimized out.
118
- #[ cfg( any( target_arch = "arm" ,
119
- target_arch = "mips" ,
120
- target_arch = "mipsel" ) ) ]
118
+ #[ cfg( all( not( feature = "external_funcs" ) ,
119
+ not( feature = "external_crate" ) ,
120
+ any( target_arch = "arm" ,
121
+ target_arch = "mips" ,
122
+ target_arch = "mipsel" ) ) ) ]
121
123
const MIN_ALIGN : uint = 8 ;
122
- #[ cfg( any( target_arch = "x86" ,
123
- target_arch = "x86_64" ) ) ]
124
+ #[ cfg( all( not( feature = "external_funcs" ) ,
125
+ not( feature = "external_crate" ) ,
126
+ any( target_arch = "x86" ,
127
+ target_arch = "x86_64" ) ) ) ]
124
128
const MIN_ALIGN : uint = 16 ;
125
129
126
- #[ cfg( external_funcs) ]
130
+ #[ cfg( feature = " external_funcs" ) ]
127
131
mod imp {
128
132
extern {
129
133
fn rust_allocate ( size : uint , align : uint ) -> * mut u8 ;
@@ -141,14 +145,13 @@ mod imp {
141
145
}
142
146
143
147
#[ inline]
144
- pub unsafe fn reallocate_inplace ( ptr : * mut u8 , old_size : uint , size : uint ,
145
- align : uint ) -> uint {
146
- rust_reallocate_inplace ( ptr, old_size, size, align)
148
+ pub unsafe fn deallocate ( ptr : * mut u8 , old_size : uint , align : uint ) {
149
+ rust_deallocate ( ptr, old_size, align)
147
150
}
148
151
149
152
#[ inline]
150
- pub unsafe fn deallocate ( ptr : * mut u8 , old_size : uint , align : uint ) {
151
- rust_deallocate ( ptr, old_size, align)
153
+ pub unsafe fn reallocate ( ptr : * mut u8 , old_size : uint , size : uint , align : uint ) -> * mut u8 {
154
+ rust_reallocate ( ptr, old_size, size , align)
152
155
}
153
156
154
157
#[ inline]
@@ -168,14 +171,16 @@ mod imp {
168
171
}
169
172
}
170
173
171
- #[ cfg( external_crate) ]
174
+ #[ cfg( feature = " external_crate" ) ]
172
175
mod imp {
173
176
extern crate external;
174
177
pub use self :: external:: { allocate, deallocate, reallocate_inplace, reallocate} ;
175
178
pub use self :: external:: { usable_size, stats_print} ;
176
179
}
177
180
178
- #[ cfg( all( not( external_funcs) , not( external_crate) , jemalloc) ) ]
181
+ #[ cfg( all( not( feature = "external_funcs" ) ,
182
+ not( feature = "external_crate" ) ,
183
+ jemalloc) ) ]
179
184
mod imp {
180
185
use core:: option:: Option ;
181
186
use core:: option:: Option :: None ;
@@ -252,7 +257,10 @@ mod imp {
252
257
}
253
258
}
254
259
255
- #[ cfg( all( not( external_funcs) , not( external_crate) , not( jemalloc) , unix) ) ]
260
+ #[ cfg( all( not( feature = "external_funcs" ) ,
261
+ not( feature = "external_crate" ) ,
262
+ not( jemalloc) ,
263
+ unix) ) ]
256
264
mod imp {
257
265
use core:: cmp;
258
266
use core:: ptr;
@@ -313,7 +321,10 @@ mod imp {
313
321
pub fn stats_print ( ) { }
314
322
}
315
323
316
- #[ cfg( all( not( external_funcs) , not( external_crate) , not( jemalloc) , windows) ) ]
324
+ #[ cfg( all( not( feature = "external_funcs" ) ,
325
+ not( feature = "external_crate" ) ,
326
+ not( jemalloc) ,
327
+ windows) ) ]
317
328
mod imp {
318
329
use libc:: { c_void, size_t} ;
319
330
use libc;
0 commit comments