MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rte_is_aligned

Function rte_is_aligned

dpdk/lib/eal/include/rte_common.h:487–491  ·  view source on GitHub ↗

* Checks if a pointer is aligned to a given power-of-two value * * @param ptr * The pointer whose alignment is to be checked * @param align * The power-of-two value to which the ptr should be aligned * * @return * True(1) where the pointer is correctly aligned, false(0) otherwise */

Source from the content-addressed store, hash-verified

485 * True(1) where the pointer is correctly aligned, false(0) otherwise
486 */
487static inline int
488rte_is_aligned(const void * const __rte_restrict ptr, const unsigned int align)
489{
490 return ((uintptr_t)ptr & (align - 1)) == 0;
491}
492
493/*********** Macros for compile type checks ********/
494

Callers 9

rte_extmem_registerFunction · 0.50
mlx4_mr_create_primaryFunction · 0.50
virtio_xmit_pkts_packedFunction · 0.50
virtio_xmit_pktsFunction · 0.50
virtio_xmit_pkts_inorderFunction · 0.50
mlx5_mr_create_primaryFunction · 0.50
test_alignFunction · 0.50
test_zero_aligned_allocFunction · 0.50

Calls

no outgoing calls

Tested by 2

test_alignFunction · 0.40
test_zero_aligned_allocFunction · 0.40