This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients jtaylor, mapreri, methane, vstinner
Date 2017-04-25.09:05:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1493111145.88.0.621571946728.issue30150@psf.upfronthosting.co.za>
In-reply-to
Content
> On for example x32 malloc returns 16 byte aligned memory but size_t is 4 bytes.

x32 is a strange platform :-( Does numpy support it? I'm not sure that Python works on such platform.

I suggest to hardcode 16 or 32 bytes in _PyMem_DebugRawAlloc instead of relying on sizeof(size_t). pymalloc aligns memory allocations to 8 bytes if I recall correctly.


> How it cause problem?

numpy uses SIMD instructions which require strict memory alignement.

Note: There was also an issue #18835 to "Add aligned memory variants to the suite of PyMem functions/macros", but it was rejected.
History
Date User Action Args
2017-04-25 09:05:45vstinnersetrecipients: + vstinner, methane, jtaylor, mapreri
2017-04-25 09:05:45vstinnersetmessageid: <1493111145.88.0.621571946728.issue30150@psf.upfronthosting.co.za>
2017-04-25 09:05:45vstinnerlinkissue30150 messages
2017-04-25 09:05:45vstinnercreate