Hi, in an C extension i need to generate ruby strings, where str->ptr is aligned to a 16 byte boundary. This is necessary so that the data can be used with simd engines (AltiVec, SSE, ...). Is there a way to do this? Cheers detlef
on 2007-04-22 15:09
on 2007-04-22 15:51
Detlef Reichl wrote: > > There's no way to tell Ruby to align its strings this way. Your only option is to make a copy aligned to your needs.
on 2007-04-24 02:42
On 4/22/07, Timothy Hunter <TimHunter@nc.rr.com> wrote: > > detlef > > > > > There's no way to tell Ruby to align its strings this way. Your only option is to make a copy aligned to your needs. > > > Without looking at the ruby source code to see if there is a hack for alignment, one thought that occurs is to create your string 16 bytes larger than required -- find the correct offset that is aligned, do the work and then adjust the string as necessary to the correct start. pth