Function ointers::unpack

source ·
pub unsafe fn unpack<T: Sized>(packed: *mut T, a: u8, s: bool, v: u8) -> *mut T
Expand description

Turns the sizeof(usize) - (a + s + v) bits of a usize (as returned from pack) back into a pointer.


The pointer must be of the correct type, otherwise you’re basically unsafely casting the pointer.

You must use the same settings as you packed the pointer with. The pointer must be packed into the lower bits. Not strictly unsafe, but indicative of a bug in your program.