tikv_jemallocator

Function layout_to_flags

source
pub(crate) fn layout_to_flags(align: usize, size: usize) -> c_int
Expand description

If align is less than _Alignof(max_align_t), and if the requested allocation size is larger than the alignment, we are guaranteed to get a suitably aligned allocation by default, without passing extra flags, and this function returns 0.

Otherwise, it returns the alignment flag to pass to the jemalloc APIs.