Skip to content

Commit 1b1b233

Browse files
committed
---
yaml --- r: 236553 b: refs/heads/tmp c: 459f772 h: refs/heads/master i: 236551: e120579 v: v3
1 parent 529c93c commit 1b1b233

File tree

5 files changed

+33
-11
lines changed

5 files changed

+33
-11
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2626
refs/heads/beta: d2e13e822a73e0ea46ae9e21afdd3155fc997f6d
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
28-
refs/heads/tmp: 06812c29991d1b4bd43feef1deb4fb8ad0cf404f
28+
refs/heads/tmp: 459f7720b99db16f3b9017820b1979698ba8c90b
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: f859507de8c410b648d934d8f5ec1c52daac971d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828

branches/tmp/src/liballoc/arc.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,9 @@ impl<T: ?Sized> Arc<T> {
307307

308308
if self.inner().weak.fetch_sub(1, Release) == 1 {
309309
atomic::fence(Acquire);
310-
deallocate(ptr as *mut u8, size_of_val(&*ptr), align_of_val(&*ptr))
310+
deallocate(ptr as *mut u8,
311+
size_of_val(&*ptr),
312+
align_of_val(&*ptr))
311313
}
312314
}
313315
}
@@ -719,7 +721,11 @@ impl<T: ?Sized> Drop for Weak<T> {
719721
// ref, which can only happen after the lock is released.
720722
if self.inner().weak.fetch_sub(1, Release) == 1 {
721723
atomic::fence(Acquire);
722-
unsafe { deallocate(ptr as *mut u8, size_of_val(&*ptr), align_of_val(&*ptr)) }
724+
unsafe {
725+
deallocate(ptr as *mut u8,
726+
size_of_val(&*ptr),
727+
align_of_val(&*ptr))
728+
}
723729
}
724730
}
725731
}

branches/tmp/src/liballoc/heap.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,12 @@ extern {
3434
#[inline(always)]
3535
fn check_size_and_alignment(size: usize, align: usize) {
3636
debug_assert!(size != 0);
37-
debug_assert!(size <= isize::MAX as usize, "Tried to allocate too much: {} bytes", size);
38-
debug_assert!(usize::is_power_of_two(align), "Invalid alignment of allocation: {}", align);
37+
debug_assert!(size <= isize::MAX as usize,
38+
"Tried to allocate too much: {} bytes",
39+
size);
40+
debug_assert!(usize::is_power_of_two(align),
41+
"Invalid alignment of allocation: {}",
42+
align);
3943
}
4044

4145
// FIXME: #13996: mark the `allocate` and `reallocate` return value as `noalias`

branches/tmp/src/liballoc/raw_vec.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,10 @@ impl<T> RawVec<T> {
274274
let ptr = if self.cap == 0 {
275275
heap::allocate(new_alloc_size, align)
276276
} else {
277-
heap::reallocate(self.ptr() as *mut _, self.cap * elem_size, new_alloc_size, align)
277+
heap::reallocate(self.ptr() as *mut _,
278+
self.cap * elem_size,
279+
new_alloc_size,
280+
align)
278281
};
279282

280283
// If allocate or reallocate fail, we'll get `null` back
@@ -358,7 +361,10 @@ impl<T> RawVec<T> {
358361
let ptr = if self.cap == 0 {
359362
heap::allocate(new_alloc_size, align)
360363
} else {
361-
heap::reallocate(self.ptr() as *mut _, self.cap * elem_size, new_alloc_size, align)
364+
heap::reallocate(self.ptr() as *mut _,
365+
self.cap * elem_size,
366+
new_alloc_size,
367+
align)
362368
};
363369

364370
// If allocate or reallocate fail, we'll get `null` back
@@ -392,7 +398,8 @@ impl<T> RawVec<T> {
392398
}
393399

394400
// This check is my waterloo; it's the only thing Vec wouldn't have to do.
395-
assert!(self.cap >= amount, "Tried to shrink to a larger capacity");
401+
assert!(self.cap >= amount,
402+
"Tried to shrink to a larger capacity");
396403

397404
if amount == 0 {
398405
mem::replace(self, RawVec::new());
@@ -466,6 +473,7 @@ impl<T> Drop for RawVec<T> {
466473
#[inline]
467474
fn alloc_guard(alloc_size: usize) {
468475
if core::usize::BITS < 64 {
469-
assert!(alloc_size <= ::core::isize::MAX as usize, "capacity overflow");
476+
assert!(alloc_size <= ::core::isize::MAX as usize,
477+
"capacity overflow");
470478
}
471479
}

branches/tmp/src/liballoc/rc.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,9 @@ impl<T: ?Sized> Drop for Rc<T> {
466466
self.dec_weak();
467467

468468
if self.weak() == 0 {
469-
deallocate(ptr as *mut u8, size_of_val(&*ptr), align_of_val(&*ptr))
469+
deallocate(ptr as *mut u8,
470+
size_of_val(&*ptr),
471+
align_of_val(&*ptr))
470472
}
471473
}
472474
}
@@ -785,7 +787,9 @@ impl<T: ?Sized> Drop for Weak<T> {
785787
// the weak count starts at 1, and will only go to zero if all
786788
// the strong pointers have disappeared.
787789
if self.weak() == 0 {
788-
deallocate(ptr as *mut u8, size_of_val(&*ptr), align_of_val(&*ptr))
790+
deallocate(ptr as *mut u8,
791+
size_of_val(&*ptr),
792+
align_of_val(&*ptr))
789793
}
790794
}
791795
}

0 commit comments

Comments
 (0)