* 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 */
| 485 | * True(1) where the pointer is correctly aligned, false(0) otherwise |
| 486 | */ |
| 487 | static inline int |
| 488 | rte_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 |
no outgoing calls