Skip to content

Commit fcc6c7b

Browse files
committed
box_free_worker: Pull out version that just borrows alloc
1 parent e6414d2 commit fcc6c7b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/liballoc/alloc.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@ unsafe fn exchange_malloc(size: usize, align: usize) -> *mut u8 {
177177
#[cfg_attr(not(test), lang = "box_free")]
178178
#[inline]
179179
pub(crate) unsafe fn box_free<T: ?Sized, A: Alloc>(ptr: Unique<T>, mut a: A) {
180+
box_free_worker(ptr, &mut a)
181+
}
182+
183+
#[inline]
184+
pub(crate) unsafe fn box_free_worker<T: ?Sized, A: Alloc>(ptr: Unique<T>, a: &mut A) {
180185
let ptr = ptr.as_ptr();
181186
let size = size_of_val(&*ptr);
182187
let align = min_align_of_val(&*ptr);

0 commit comments

Comments
 (0)