@@ -152,7 +152,7 @@ impl System {
152
152
// SAFETY: Same as `AllocRef::grow`
153
153
#[ inline]
154
154
unsafe fn grow_impl (
155
- & mut self ,
155
+ & self ,
156
156
ptr : NonNull < u8 > ,
157
157
old_layout : Layout ,
158
158
new_layout : Layout ,
@@ -190,7 +190,7 @@ impl System {
190
190
old_size => unsafe {
191
191
let new_ptr = self . alloc_impl ( new_layout, zeroed) ?;
192
192
ptr:: copy_nonoverlapping ( ptr. as_ptr ( ) , new_ptr. as_mut_ptr ( ) , old_size) ;
193
- self . dealloc ( ptr, old_layout) ;
193
+ AllocRef :: dealloc ( & self , ptr, old_layout) ;
194
194
Ok ( new_ptr)
195
195
} ,
196
196
}
@@ -222,7 +222,7 @@ unsafe impl AllocRef for System {
222
222
223
223
#[ inline]
224
224
unsafe fn grow (
225
- & mut self ,
225
+ & self ,
226
226
ptr : NonNull < u8 > ,
227
227
old_layout : Layout ,
228
228
new_layout : Layout ,
@@ -233,7 +233,7 @@ unsafe impl AllocRef for System {
233
233
234
234
#[ inline]
235
235
unsafe fn grow_zeroed (
236
- & mut self ,
236
+ & self ,
237
237
ptr : NonNull < u8 > ,
238
238
old_layout : Layout ,
239
239
new_layout : Layout ,
@@ -244,7 +244,7 @@ unsafe impl AllocRef for System {
244
244
245
245
#[ inline]
246
246
unsafe fn shrink (
247
- & mut self ,
247
+ & self ,
248
248
ptr : NonNull < u8 > ,
249
249
old_layout : Layout ,
250
250
new_layout : Layout ,
@@ -257,7 +257,7 @@ unsafe impl AllocRef for System {
257
257
match new_layout. size ( ) {
258
258
// SAFETY: conditions must be upheld by the caller
259
259
0 => unsafe {
260
- self . dealloc ( ptr, old_layout) ;
260
+ AllocRef :: dealloc ( & self , ptr, old_layout) ;
261
261
Ok ( NonNull :: slice_from_raw_parts ( new_layout. dangling ( ) , 0 ) )
262
262
} ,
263
263
@@ -277,9 +277,9 @@ unsafe impl AllocRef for System {
277
277
// `new_ptr`. Thus, the call to `copy_nonoverlapping` is safe. The safety contract
278
278
// for `dealloc` must be upheld by the caller.
279
279
new_size => unsafe {
280
- let new_ptr = self . alloc ( new_layout) ?;
280
+ let new_ptr = AllocRef :: alloc ( & self , new_layout) ?;
281
281
ptr:: copy_nonoverlapping ( ptr. as_ptr ( ) , new_ptr. as_mut_ptr ( ) , new_size) ;
282
- self . dealloc ( ptr, old_layout) ;
282
+ AllocRef :: dealloc ( & self , ptr, old_layout) ;
283
283
Ok ( new_ptr)
284
284
} ,
285
285
}
0 commit comments