STINNER Victor added the comment:

> 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.

----------
nosy: +haypo

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30150>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to