diff options
Diffstat (limited to 'src/engine/EventBuffer.cpp')
-rw-r--r-- | src/engine/EventBuffer.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/engine/EventBuffer.cpp b/src/engine/EventBuffer.cpp index e57312ad..45ef47f0 100644 --- a/src/engine/EventBuffer.cpp +++ b/src/engine/EventBuffer.cpp @@ -40,7 +40,13 @@ EventBuffer::EventBuffer(size_t capacity) throw std::bad_alloc(); } +#ifdef HAVE_POSIX_MEMALIGN int ret = posix_memalign((void**)&_local_buf, 16, sizeof(LV2_Event_Buffer) + capacity); +#else + _local_buf = (LV2_Event_Buffer*)malloc(sizeof(LV2_Event_Buffer) + capacity); + int ret = (_local_buf == NULL); +#endif + if (ret) { cerr << "Failed to allocate event buffer. Aborting." << endl; exit(EXIT_FAILURE); |