@@ -115,15 +115,19 @@ unsafe fn exchange_free(ptr: *mut u8, old_size: uint, align: uint) {
115115// The minimum alignment guaranteed by the architecture. This value is used to
116116// add fast paths for low alignment values. In practice, the alignment is a
117117// 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" ) ) ) ]
121123const 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" ) ) ) ]
124128const MIN_ALIGN : uint = 16 ;
125129
126- #[ cfg( external_funcs) ]
130+ #[ cfg( feature = " external_funcs" ) ]
127131mod imp {
128132 extern {
129133 fn rust_allocate ( size : uint , align : uint ) -> * mut u8 ;
@@ -141,14 +145,13 @@ mod imp {
141145 }
142146
143147 #[ 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)
147150 }
148151
149152 #[ 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)
152155 }
153156
154157 #[ inline]
@@ -168,14 +171,16 @@ mod imp {
168171 }
169172}
170173
171- #[ cfg( external_crate) ]
174+ #[ cfg( feature = " external_crate" ) ]
172175mod imp {
173176 extern crate external;
174177 pub use self :: external:: { allocate, deallocate, reallocate_inplace, reallocate} ;
175178 pub use self :: external:: { usable_size, stats_print} ;
176179}
177180
178- #[ cfg( all( not( external_funcs) , not( external_crate) , jemalloc) ) ]
181+ #[ cfg( all( not( feature = "external_funcs" ) ,
182+ not( feature = "external_crate" ) ,
183+ jemalloc) ) ]
179184mod imp {
180185 use core:: option:: Option ;
181186 use core:: option:: Option :: None ;
@@ -252,7 +257,10 @@ mod imp {
252257 }
253258}
254259
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) ) ]
256264mod imp {
257265 use core:: cmp;
258266 use core:: ptr;
@@ -313,7 +321,10 @@ mod imp {
313321 pub fn stats_print ( ) { }
314322}
315323
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) ) ]
317328mod imp {
318329 use libc:: { c_void, size_t} ;
319330 use libc;
0 commit comments