File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -222,9 +222,14 @@ unsafe fn exchange_malloc(size: usize, align: usize) -> *mut u8 {
222
222
#[ cfg_attr( not( test) , lang = "box_free" ) ]
223
223
#[ inline]
224
224
pub ( crate ) unsafe fn box_free < T : ?Sized , A : Alloc > ( ptr : Unique < T > , mut a : A ) {
225
+ box_free_worker ( ptr, & mut a)
226
+ }
227
+
228
+ #[ inline]
229
+ pub ( crate ) unsafe fn box_free_worker < T : ?Sized , A : Alloc > ( ptr : Unique < T > , a : & mut A ) {
225
230
let size = size_of_val ( & * ptr. as_ptr ( ) ) ;
226
231
let align = min_align_of_val ( & * ptr. as_ptr ( ) ) ;
227
- // We do not allocate for Box<T, A > when T is ZST, so deallocation is also not necessary.
232
+ // We do not allocate for Box<T> when T is ZST, so deallocation is also not necessary.
228
233
if size != 0 {
229
234
let layout = Layout :: from_size_align_unchecked ( size, align) ;
230
235
a. dealloc ( NonNull :: from ( ptr) . cast ( ) , layout) ;
You can’t perform that action at this time.
0 commit comments