* Memory allocation optionally with alignment. * * @param[in] align * Alignment size (may be zero) * @param[in] size * Size in bytes to allocate * * @return * Valid pointer to allocated memory, NULL in case of failure */
| 254 | * Valid pointer to allocated memory, NULL in case of failure |
| 255 | */ |
| 256 | static inline void * |
| 257 | mlx5_os_malloc(size_t align, size_t size) |
| 258 | { |
| 259 | void *buf; |
| 260 | |
| 261 | if (posix_memalign(&buf, align, size)) |
| 262 | return NULL; |
| 263 | return buf; |
| 264 | } |
| 265 | |
| 266 | /** |
| 267 | * This API de-allocates a memory that originally could have been |