@@ -74,7 +74,7 @@ impl<T> ArenaChunk<T> {
74
74
#[ inline]
75
75
unsafe fn new ( capacity : usize ) -> ArenaChunk < T > {
76
76
ArenaChunk {
77
- storage : NonNull :: new ( Box :: into_raw ( Box :: new_uninit_slice ( capacity) ) ) . unwrap ( ) ,
77
+ storage : NonNull :: new_unchecked ( Box :: into_raw ( Box :: new_uninit_slice ( capacity) ) ) ,
78
78
entries : 0 ,
79
79
}
80
80
}
@@ -85,7 +85,7 @@ impl<T> ArenaChunk<T> {
85
85
// The branch on needs_drop() is an -O1 performance optimization.
86
86
// Without the branch, dropping TypedArena<u8> takes linear time.
87
87
if mem:: needs_drop :: < T > ( ) {
88
- let slice = & mut * ( self . storage . as_mut ( ) ) ;
88
+ let slice = self . storage . as_mut ( ) ;
89
89
ptr:: drop_in_place ( MaybeUninit :: slice_assume_init_mut ( & mut slice[ ..len] ) ) ;
90
90
}
91
91
}
@@ -104,7 +104,7 @@ impl<T> ArenaChunk<T> {
104
104
// A pointer as large as possible for zero-sized elements.
105
105
ptr:: invalid_mut ( !0 )
106
106
} else {
107
- self . start ( ) . add ( ( * self . storage . as_ptr ( ) ) . len ( ) )
107
+ self . start ( ) . add ( self . storage . len ( ) )
108
108
}
109
109
}
110
110
}
@@ -288,7 +288,7 @@ impl<T> TypedArena<T> {
288
288
// If the previous chunk's len is less than HUGE_PAGE
289
289
// bytes, then this chunk will be least double the previous
290
290
// chunk's size.
291
- new_cap = ( * last_chunk. storage . as_ptr ( ) ) . len ( ) . min ( HUGE_PAGE / elem_size / 2 ) ;
291
+ new_cap = last_chunk. storage . len ( ) . min ( HUGE_PAGE / elem_size / 2 ) ;
292
292
new_cap *= 2 ;
293
293
} else {
294
294
new_cap = PAGE / elem_size;
@@ -396,7 +396,7 @@ impl DroplessArena {
396
396
// If the previous chunk's len is less than HUGE_PAGE
397
397
// bytes, then this chunk will be least double the previous
398
398
// chunk's size.
399
- new_cap = ( * last_chunk. storage . as_ptr ( ) ) . len ( ) . min ( HUGE_PAGE / 2 ) ;
399
+ new_cap = last_chunk. storage . len ( ) . min ( HUGE_PAGE / 2 ) ;
400
400
new_cap *= 2 ;
401
401
} else {
402
402
new_cap = PAGE ;
0 commit comments