mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-25 16:07:49 +01:00
posix_memalign fixes from RB svn
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3580 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
61fe7e0c3a
commit
da41e49022
1 changed files with 5 additions and 0 deletions
|
|
@ -25,6 +25,7 @@
|
|||
#endif /* !__APPLE__, !_WIN32 */
|
||||
#endif /* !_WIN32 */
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
|
@ -108,7 +109,9 @@ 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;
|
||||
|
|
@ -130,7 +133,9 @@ 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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue