#pragma once #include static inline void *camu_page_alloc(size_t size) { #ifdef AL_HAVE_POSIX_MEMALIGN void *ptr = NULL; if (al_posix_memalign(&ptr, al_page_size, size) != 0) { // For possible EINVAL rather than ENOMEM. return NULL; } return ptr; #else return al_malloc(size); #endif } static inline void *camu_page_realloc(void *ptr, size_t size) { return al_realloc(ptr, size); }