@@ -283,7 +283,7 @@ extra_only! {
283
283
#[ repr( C ) ]
284
284
struct CellHeader {
285
285
next_cell_raw : ptr:: NonNull < CellHeader > ,
286
- prev_cell : * mut CellHeader ,
286
+ prev_cell_raw : * mut CellHeader ,
287
287
}
288
288
289
289
#[ repr( C ) ]
@@ -415,10 +415,10 @@ impl CellHeader {
415
415
}
416
416
417
417
fn prev_cell ( & self ) -> Option < * mut CellHeader > {
418
- if self . prev_cell . is_null ( ) {
418
+ if self . prev_cell_raw . is_null ( ) {
419
419
None
420
420
} else {
421
- Some ( self . prev_cell )
421
+ Some ( self . prev_cell_raw )
422
422
}
423
423
}
424
424
@@ -460,7 +460,7 @@ impl FreeCell {
460
460
// true:
461
461
//
462
462
// * `FreeCell::next_free_raw` (and'd with the mask) is not null.
463
- // * `FreeCell::next_free_raw` is the adjacent `CellHeader::prev_cell `.
463
+ // * `FreeCell::next_free_raw` is the adjacent `CellHeader::prev_cell_raw `.
464
464
//
465
465
// Therefore, this free cell can be merged into a single, larger, contiguous
466
466
// free cell with its previous neighbor, which is also the next cell in the
@@ -505,7 +505,7 @@ impl FreeCell {
505
505
FreeCell {
506
506
header : CellHeader {
507
507
next_cell_raw : next_cell,
508
- prev_cell,
508
+ prev_cell_raw : prev_cell,
509
509
} ,
510
510
next_free_raw : next_free,
511
511
} ,
@@ -575,7 +575,7 @@ impl FreeCell {
575
575
576
576
if let Some ( next) = self . header . next_cell ( ) {
577
577
unsafe {
578
- ( * next) . prev_cell = & mut remainder. header ;
578
+ ( * next) . prev_cell_raw = & mut remainder. header ;
579
579
}
580
580
}
581
581
self . header . next_cell_raw =
@@ -676,7 +676,7 @@ extra_only! {
676
676
if let Some ( cell_ref) = cell. as_ref( ) {
677
677
assert!( cell_ref. size( ) >= size_of:: <usize >( ) ) ;
678
678
679
- if let Some ( prev) = cell_ref. prev_cell. as_ref( ) {
679
+ if let Some ( prev) = cell_ref. prev_cell( ) . and_then ( |p| p . as_ref( ) ) {
680
680
assert!( prev. size( ) >= size_of:: <usize >( ) ) ;
681
681
assert!( !prev. next_cell_is_invalid( ) ) ;
682
682
assert_eq!( prev. next_cell_unchecked( ) , cell, "next(prev(cell)) == cell" ) ;
@@ -686,7 +686,7 @@ extra_only! {
686
686
assert!( !next. is_null( ) ) ;
687
687
let next = & * next;
688
688
assert!( next. size( ) >= size_of:: <usize >( ) ) ;
689
- assert_eq!( next. prev_cell , cell, "prev(next(cell)) == cell" ) ;
689
+ assert_eq!( next. prev_cell_raw , cell, "prev(next(cell)) == cell" ) ;
690
690
}
691
691
692
692
if let Some ( free) = cell_ref. as_free_cell( ) {
@@ -850,13 +850,13 @@ where
850
850
// don't merge, only to immediately split the cell again right
851
851
// afterwards.
852
852
while current_free. next_free_can_merge ( ) {
853
- let prev_adjacent = current_free. header . prev_cell as * mut FreeCell ;
853
+ let prev_adjacent = current_free. header . prev_cell_raw as * mut FreeCell ;
854
854
extra_assert_eq ! ( prev_adjacent, current_free. next_free( ) ) ;
855
855
let prev_adjacent = & mut * prev_adjacent;
856
856
857
857
( * prev_adjacent) . header . next_cell_raw = current_free. header . next_cell_raw ;
858
858
if let Some ( next) = current_free. header . next_cell ( ) {
859
- ( * next) . prev_cell = & mut prev_adjacent. header ;
859
+ ( * next) . prev_cell_raw = & mut prev_adjacent. header ;
860
860
}
861
861
862
862
* previous_free = prev_adjacent;
@@ -1055,7 +1055,7 @@ unsafe impl<'a> Alloc for &'a WeeAlloc {
1055
1055
{
1056
1056
prev. header . next_cell_raw = free. header . next_cell_raw ;
1057
1057
if let Some ( next) = free. header . next_cell ( ) {
1058
- ( * next) . prev_cell = & mut prev. header ;
1058
+ ( * next) . prev_cell_raw = & mut prev. header ;
1059
1059
}
1060
1060
1061
1061
write_free_pattern ( prev, policy) ;
0 commit comments