in src/main/c/org_apache_activemq_artemis_nativo_jlibaio_LibaioContext.c [276:295]
static inline short verifyBuffer(int alignment) {
pthread_mutex_lock(&oneMegaMutex);
if (oneMegaBuffer == 0) {
#ifdef DEBUG
fprintf (stdout, "oneMegaBuffer %ld\n", (long) oneMegaBuffer);
#endif
if (posix_memalign(&oneMegaBuffer, alignment, ONE_MEGA) != 0) {
fprintf(stderr, "Could not allocate the 1 Mega Buffer for initializing files\n");
pthread_mutex_unlock(&oneMegaMutex);
return -1;
}
memset(oneMegaBuffer, 0, ONE_MEGA);
}
pthread_mutex_unlock(&oneMegaMutex);
return 0;
}