[SciPy-user] numpy aligned memory
Sun Mar 8 13:12:20 CDT 2009
On Mon, Mar 9, 2009 at 2:27 AM, Pauli Virtanen <firstname.lastname@example.org> wrote:
> Sun, 08 Mar 2009 22:33:32 +0530, Rohit Garg wrote:
>> I saw this
>> while googling for numpy memory alignment. I wish to know if anything on
>> that account has come to pass yet? On linux 64 bit platform, can I
>> assume anything beyond the glibc alignment as of now?
> You cannot assume even glibc alignment, unless the array has the ALIGNED
> flag set. (This has actually caused a few bugs also in Numpy & Scipy, cf.
> eg. #551.) For example unpickling can produce arrays that are not aligned
> at itemsize boundaries, if the original array did not have its ALIGNED
> flag set.
You can assume your malloc guaranteed alignment from the memory
allocation functions, though. Even if/when aligned allocator will be
available in numpy, only newly allocated buffers will be concerned.
More information about the SciPy-user