Function sp_std::mem::align_of_val_raw[][src]

pub const unsafe fn align_of_val_raw<T>(val: *const T) -> usize where
    T: ?Sized
🔬 This is a nightly-only experimental API. (layout_for_ptr)

Returns the ABI-required minimum alignment of the type of the value that val points to.

Every reference to a value of the type T must be a multiple of this number.

Safety

This function is only safe to call if the following conditions hold:

Examples

#![feature(layout_for_ptr)]
use std::mem;

assert_eq!(4, unsafe { mem::align_of_val_raw(&5i32) });