@@ -115,16 +115,20 @@ 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
- target_arch = "aarch64" ) ) ]
124
+ #[ cfg( all( not( feature = "external_funcs" ) ,
125
+ not( feature = "external_crate" ) ,
126
+ any( target_arch = "x86" ,
127
+ target_arch = "x86_64" ,
128
+ target_arch = "aarch64" ) ) ]
125
129
const MIN_ALIGN : uint = 16 ;
126
130
127
- #[ cfg( external_funcs) ]
131
+ #[ cfg( feature = " external_funcs" ) ]
128
132
mod imp {
129
133
extern {
130
134
fn rust_allocate( size: uint, align: uint) -> * mut u8 ;
@@ -142,14 +146,13 @@ mod imp {
142
146
}
143
147
144
148
#[ inline]
145
- pub unsafe fn reallocate_inplace ( ptr : * mut u8 , old_size : uint , size : uint ,
146
- align : uint ) -> uint {
147
- rust_reallocate_inplace ( ptr, old_size, size, align)
149
+ pub unsafe fn deallocate( ptr: * mut u8 , old_size: uint, align: uint) {
150
+ rust_deallocate( ptr, old_size, align)
148
151
}
149
152
150
153
#[ inline]
151
- pub unsafe fn deallocate ( ptr : * mut u8 , old_size : uint , align : uint ) {
152
- rust_deallocate ( ptr, old_size, align)
154
+ pub unsafe fn reallocate ( ptr: * mut u8 , old_size: uint, size : uint , align: uint) -> * mut u8 {
155
+ rust_reallocate ( ptr, old_size, size , align)
153
156
}
154
157
155
158
#[ inline]
@@ -169,14 +172,16 @@ mod imp {
169
172
}
170
173
}
171
174
172
- #[ cfg( external_crate) ]
175
+ #[ cfg( feature = " external_crate" ) ]
173
176
mod imp {
174
177
extern crate external;
175
178
pub use self :: external:: { allocate, deallocate, reallocate_inplace, reallocate} ;
176
179
pub use self :: external:: { usable_size, stats_print} ;
177
180
}
178
181
179
- #[ cfg( all( not( external_funcs) , not( external_crate) , jemalloc) ) ]
182
+ #[ cfg( all( not( feature = "external_funcs" ) ,
183
+ not( feature = "external_crate" ) ,
184
+ jemalloc) ) ]
180
185
mod imp {
181
186
use core:: option:: Option ;
182
187
use core:: option:: Option :: None ;
@@ -253,7 +258,10 @@ mod imp {
253
258
}
254
259
}
255
260
256
- #[ cfg( all( not( external_funcs) , not( external_crate) , not( jemalloc) , unix) ) ]
261
+ #[ cfg( all( not( feature = "external_funcs" ) ,
262
+ not( feature = "external_crate" ) ,
263
+ not( jemalloc) ,
264
+ unix) ) ]
257
265
mod imp {
258
266
use core:: cmp;
259
267
use core:: ptr;
@@ -314,7 +322,10 @@ mod imp {
314
322
pub fn stats_print( ) { }
315
323
}
316
324
317
- #[ cfg( all( not( external_funcs) , not( external_crate) , not( jemalloc) , windows) ) ]
325
+ #[ cfg( all( not( feature = "external_funcs" ) ,
326
+ not( feature = "external_crate" ) ,
327
+ not( jemalloc) ,
328
+ windows) ) ]
318
329
mod imp {
319
330
use libc:: { c_void, size_t} ;
320
331
use libc;
0 commit comments