File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -229,10 +229,15 @@ type BoxFreeAlloc<A> = A;
229
229
230
230
#[ cfg_attr( not( test) , lang = "box_free" ) ]
231
231
#[ inline]
232
- pub ( crate ) unsafe fn box_free < T : ?Sized , A : Stage0Alloc > ( ptr : Unique < T > , a : BoxFreeAlloc < A > ) {
232
+ pub ( crate ) unsafe fn box_free < T : ?Sized , A : Alloc > ( ptr : Unique < T > , mut a : BoxFreeAlloc < A > ) {
233
+ box_free_worker ( ptr, & mut a)
234
+ }
235
+
236
+ #[ inline]
237
+ pub ( crate ) unsafe fn box_free_worker < T : ?Sized , A : Alloc > ( ptr : Unique < T > , a : & mut BoxFreeAlloc < A > ) {
233
238
let size = size_of_val ( & * ptr. as_ptr ( ) ) ;
234
239
let align = min_align_of_val ( & * ptr. as_ptr ( ) ) ;
235
- // We do not allocate for Box<T, A > when T is ZST, so deallocation is also not necessary.
240
+ // We do not allocate for Box<T> when T is ZST, so deallocation is also not necessary.
236
241
if size != 0 {
237
242
let layout = Layout :: from_size_align_unchecked ( size, align) ;
238
243
stage0_unphantom ( a) . dealloc ( NonNull :: from ( ptr) . cast ( ) , layout) ;
You can’t perform that action at this time.
0 commit comments