Skip to content

Commit 65d16bf

Browse files
committed
---
yaml --- r: 157045 b: refs/heads/try c: a9e8510 h: refs/heads/master i: 157043: fe70c4d v: v3
1 parent 5c7a95f commit 65d16bf

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 2d27bfaeb6522d386d0a2735cb3f75cc5707314a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: d44ea720fa9dfe062ef06d0eb49a58d4e7e92344
5-
refs/heads/try: a6426cb43dd24d0949755da57da85f3739fd9230
5+
refs/heads/try: a9e85100cd598ddb9395b2ad31b31e0f9df84f22
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 6601b0501e31d08d3892a2d5a7d8a57ab120bf75

branches/try/src/liballoc/heap.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ pub unsafe fn allocate(size: uint, align: uint) -> *mut u8 {
2828
/// size on the platform.
2929
///
3030
/// 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).
3333
#[inline]
3434
pub unsafe fn reallocate(ptr: *mut u8, old_size: uint, size: uint, align: uint) -> *mut u8 {
3535
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
5757
///
5858
/// The `ptr` parameter must not be null.
5959
///
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).
6363
#[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)
6666
}
6767

6868
/// 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 {
102102
#[cfg(not(test))]
103103
#[lang="exchange_free"]
104104
#[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);
107107
}
108108

109109
// The minimum alignment guaranteed by the architecture. This value is used to
@@ -185,9 +185,9 @@ mod imp {
185185
}
186186

187187
#[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) {
189189
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)
191191
}
192192

193193
#[inline]
@@ -260,7 +260,7 @@ mod imp {
260260
}
261261

262262
#[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) {
264264
libc::free(ptr as *mut libc::c_void)
265265
}
266266

@@ -328,7 +328,7 @@ mod imp {
328328
}
329329

330330
#[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) {
332332
if align <= MIN_ALIGN {
333333
libc::free(ptr as *mut libc::c_void)
334334
} else {

0 commit comments

Comments
 (0)