heap_remove, sp_brightness_grid_into_packet

This commit is contained in:
Vinzenz Schroeter 2025-04-12 21:56:07 +02:00
commit 1e442012be
6 changed files with 42 additions and 13 deletions

View file

@ -61,5 +61,9 @@ pub(crate) fn heap_move_nonnull<T>(x: T) -> NonNull<T> {
}
pub(crate) unsafe fn heap_drop<T>(x: NonNull<T>) {
drop(unsafe { Box::from_raw(x.as_ptr()) });
drop(unsafe { heap_remove(x) });
}
pub(crate) unsafe fn heap_remove<T>(x: NonNull<T>) -> T {
unsafe { *Box::from_raw(x.as_ptr()) }
}