@@ -152,7 +152,7 @@ impl System {
152152 // SAFETY: Same as `AllocRef::grow`
153153 #[ inline]
154154 unsafe fn grow_impl (
155- & mut self ,
155+ & self ,
156156 ptr : NonNull < u8 > ,
157157 old_layout : Layout ,
158158 new_layout : Layout ,
@@ -190,7 +190,7 @@ impl System {
190190 old_size => unsafe {
191191 let new_ptr = self . alloc_impl ( new_layout, zeroed) ?;
192192 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) ;
194194 Ok ( new_ptr)
195195 } ,
196196 }
@@ -222,7 +222,7 @@ unsafe impl AllocRef for System {
222222
223223 #[ inline]
224224 unsafe fn grow (
225- & mut self ,
225+ & self ,
226226 ptr : NonNull < u8 > ,
227227 old_layout : Layout ,
228228 new_layout : Layout ,
@@ -233,7 +233,7 @@ unsafe impl AllocRef for System {
233233
234234 #[ inline]
235235 unsafe fn grow_zeroed (
236- & mut self ,
236+ & self ,
237237 ptr : NonNull < u8 > ,
238238 old_layout : Layout ,
239239 new_layout : Layout ,
@@ -244,7 +244,7 @@ unsafe impl AllocRef for System {
244244
245245 #[ inline]
246246 unsafe fn shrink (
247- & mut self ,
247+ & self ,
248248 ptr : NonNull < u8 > ,
249249 old_layout : Layout ,
250250 new_layout : Layout ,
@@ -257,7 +257,7 @@ unsafe impl AllocRef for System {
257257 match new_layout. size ( ) {
258258 // SAFETY: conditions must be upheld by the caller
259259 0 => unsafe {
260- self . dealloc ( ptr, old_layout) ;
260+ AllocRef :: dealloc ( & self , ptr, old_layout) ;
261261 Ok ( NonNull :: slice_from_raw_parts ( new_layout. dangling ( ) , 0 ) )
262262 } ,
263263
@@ -277,9 +277,9 @@ unsafe impl AllocRef for System {
277277 // `new_ptr`. Thus, the call to `copy_nonoverlapping` is safe. The safety contract
278278 // for `dealloc` must be upheld by the caller.
279279 new_size => unsafe {
280- let new_ptr = self . alloc ( new_layout) ?;
280+ let new_ptr = AllocRef :: alloc ( & self , new_layout) ?;
281281 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) ;
283283 Ok ( new_ptr)
284284 } ,
285285 }
0 commit comments