Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force 16-byte buffer alignment for SIMD #83

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 10 additions & 1 deletion libjack/port.c
Expand Up @@ -630,13 +630,22 @@ jack_port_get_buffer (jack_port_t *port, jack_nframes_t nframes)
size_t
jack_port_type_buffer_size (jack_port_type_info_t* port_type_info, jack_nframes_t nframes)
{
size_t size;

if ( port_type_info->buffer_scale_factor < 0 ) {
return port_type_info->buffer_size;
}

return port_type_info->buffer_scale_factor
size = port_type_info->buffer_scale_factor
* sizeof(jack_default_audio_sample_t)
* nframes;

#ifdef USE_DYNSIMD
/* Round up to the next multiple of 16 bytes, align buffers for SIMD. */
size = (size + 15) & (~ (size_t)0x0f);
#endif /* USE_DYNSIMD */

return size;
}

int
Expand Down