diff options
Diffstat (limited to 'libs/rubberband/src/sysutils.cpp')
-rw-r--r-- | libs/rubberband/src/sysutils.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/rubberband/src/sysutils.cpp b/libs/rubberband/src/sysutils.cpp index aa9f92d4d7..120b936729 100644 --- a/libs/rubberband/src/sysutils.cpp +++ b/libs/rubberband/src/sysutils.cpp @@ -25,6 +25,7 @@ #endif /* !__APPLE__, !_WIN32 */ #endif /* !_WIN32 */ +#include <cstdlib> #include <iostream> #include <stdlib.h> @@ -108,8 +109,10 @@ float *allocFloat(float *ptr, int count) if (ptr) free((void *)ptr); void *allocated; #ifndef _WIN32 +#ifndef __APPLE__ if (!posix_memalign(&allocated, 16, count * sizeof(float))) #endif +#endif allocated = malloc(count * sizeof(float)); for (int i = 0; i < count; ++i) ((float *)allocated)[i] = 0.f; return (float *)allocated; @@ -130,8 +133,10 @@ double *allocDouble(double *ptr, int count) if (ptr) free((void *)ptr); void *allocated; #ifndef _WIN32 +#ifndef __APPLE__ if (!posix_memalign(&allocated, 16, count * sizeof(double))) #endif +#endif allocated = malloc(count * sizeof(double)); for (int i = 0; i < count; ++i) ((double *)allocated)[i] = 0.f; return (double *)allocated; |