Florian Weimer <fwei...@redhat.com> added the comment:

Minor correction: glibc malloc follows ABI on x86-64 and always returns a 
16-byte-aligned pointer, independently of allocation size.

However, other mallocs (such as jemalloc and tcmalloc) may return pointers with 
less alignment for allocation sizes less than 16 bytes, violating ABI.  They 
still follow ABI for allocations of 16 bytes and more.

But as you said, the distinction should not matter for Python because of the 
object header.  Furthermore, without LTO, the compiler will not be able to 
detect that a pointer returned from Py_NewObject is a top-level allocation, and 
therefore has to be more conservative about alignment, using information from 
the type definitions only.

----------

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

Reply via email to