mardi 1 mars 2016

Dynamic array alignment in gcc/g++

I plan using SSE instructions applied to elements of int16_t array. Is there a way to force 16 byte alignment with new operator or uique_ptr semantics?

int16_t *array=new int16_t[N];

Is the only possibility is to use posix_memalign? I assume that using

int16_t *array __attribute__ ((aligned (16)));

will align the pointer itself only.

Aucun commentaire:

Enregistrer un commentaire