align dynamic array (for avx friendliness) hints? / possible??

james.p.leblanc james.p.leblanc at gmail.com
Tue Aug 3 12:33:56 UTC 2021


Concise question:
=================

I would like to use dynamic arrays, not for their
dynamic sizing properties per se' (slicing, appending, etc).
But, more for their memory protection and efficiencies (for
example,using foreach).

However, I must have the start of my array at an avx
friendly 32 byte alignment.

Is this easily acheivable?

Background:
===========

I am interfacing with fftw.  If I use the fftw_malloc, then
I am forced to either:

   1)  copy to/from the allocated arrays to/from my "standard"
       dlang dynamic arrays (loss of efficiency). or ...

   2)  use standard array/pointer mechanisms everywhere(loss
       of memory safely).

My thinking is that I could forego the use of the fftw_malloc,
and simply hand fftw functions my (properly aligned) pointer
of my dlang dynamic array.

All thoughts, comments, hints, greatly appreciated!

James




More information about the Digitalmars-d-learn mailing list