@@ -28,8 +28,8 @@ pub unsafe fn allocate(size: uint, align: uint) -> *mut u8 {
28
28
/// size on the platform.
29
29
///
30
30
/// The `old_size` and `align` parameters are the parameters that were used to
31
- /// create the allocation referenced by `ptr`. The `old_size` parameter may also
32
- /// be the value returned by ` usable_size` for the requested size .
31
+ /// create the allocation referenced by `ptr`. The `old_size` parameter may be
32
+ /// any value in range_inclusive(requested_size, usable_size) .
33
33
#[ inline]
34
34
pub unsafe fn reallocate ( ptr : * mut u8 , old_size : uint , size : uint , align : uint ) -> * mut u8 {
35
35
imp:: reallocate ( ptr, old_size, size, align)
@@ -57,12 +57,12 @@ pub unsafe fn reallocate_inplace(ptr: *mut u8, old_size: uint, size: uint, align
57
57
///
58
58
/// The `ptr` parameter must not be null.
59
59
///
60
- /// The `size ` and `align` parameters are the parameters that were used to
61
- /// create the allocation referenced by `ptr`. The `size ` parameter may also be
62
- /// the value returned by ` usable_size` for the requested size .
60
+ /// The `old_size ` and `align` parameters are the parameters that were used to
61
+ /// create the allocation referenced by `ptr`. The `old_size ` parameter may be
62
+ /// any value in range_inclusive(requested_size, usable_size) .
63
63
#[ inline]
64
- pub unsafe fn deallocate ( ptr : * mut u8 , size : uint , align : uint ) {
65
- imp:: deallocate ( ptr, size , align)
64
+ pub unsafe fn deallocate ( ptr : * mut u8 , old_size : uint , align : uint ) {
65
+ imp:: deallocate ( ptr, old_size , align)
66
66
}
67
67
68
68
/// Returns the usable size of an allocation created with the specified the
@@ -102,8 +102,8 @@ unsafe fn exchange_malloc(size: uint, align: uint) -> *mut u8 {
102
102
#[ cfg( not( test) ) ]
103
103
#[ lang="exchange_free" ]
104
104
#[ inline]
105
- unsafe fn exchange_free ( ptr : * mut u8 , size : uint , align : uint ) {
106
- deallocate ( ptr, size , align) ;
105
+ unsafe fn exchange_free ( ptr : * mut u8 , old_size : uint , align : uint ) {
106
+ deallocate ( ptr, old_size , align) ;
107
107
}
108
108
109
109
// The minimum alignment guaranteed by the architecture. This value is used to
@@ -185,9 +185,9 @@ mod imp {
185
185
}
186
186
187
187
#[ inline]
188
- pub unsafe fn deallocate ( ptr : * mut u8 , size : uint , align : uint ) {
188
+ pub unsafe fn deallocate ( ptr : * mut u8 , old_size : uint , align : uint ) {
189
189
let flags = align_to_flags ( align) ;
190
- je_sdallocx ( ptr as * mut c_void , size as size_t , flags)
190
+ je_sdallocx ( ptr as * mut c_void , old_size as size_t , flags)
191
191
}
192
192
193
193
#[ inline]
@@ -260,7 +260,7 @@ mod imp {
260
260
}
261
261
262
262
#[ inline]
263
- pub unsafe fn deallocate ( ptr : * mut u8 , _size : uint , _align : uint ) {
263
+ pub unsafe fn deallocate ( ptr : * mut u8 , _old_size : uint , _align : uint ) {
264
264
libc:: free ( ptr as * mut libc:: c_void )
265
265
}
266
266
@@ -328,7 +328,7 @@ mod imp {
328
328
}
329
329
330
330
#[ inline]
331
- pub unsafe fn deallocate ( ptr : * mut u8 , _size : uint , align : uint ) {
331
+ pub unsafe fn deallocate ( ptr : * mut u8 , _old_size : uint , align : uint ) {
332
332
if align <= MIN_ALIGN {
333
333
libc:: free ( ptr as * mut libc:: c_void )
334
334
} else {
0 commit comments