Align buffers to 32 byte boundaries to allow AVX processing

AVX requires 32 byte alignment, so let's align the buffers accordingly.
This commit is contained in:
Adrian Knoth 2012-05-24 23:44:30 +02:00
parent 6c06e134ab
commit 3e5a7d8988
1 changed files with 2 additions and 2 deletions

View File

@ -58,7 +58,7 @@ class SERVER_EXPORT JackPort
bool fInUse;
jack_port_id_t fTied; // Locally tied source port
jack_default_audio_sample_t fBuffer[BUFFER_SIZE_MAX + 4];
jack_default_audio_sample_t fBuffer[BUFFER_SIZE_MAX + 8];
bool IsUsed() const
{
@ -108,7 +108,7 @@ class SERVER_EXPORT JackPort
// Since we are in shared memory, the resulting pointer cannot be cached, so align it here...
jack_default_audio_sample_t* GetBuffer()
{
return (jack_default_audio_sample_t*)((uintptr_t)fBuffer & ~15L) + 4;
return (jack_default_audio_sample_t*)((uintptr_t)fBuffer & ~31L) + 8;
}
int GetRefNum() const;