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 benjamin.peterson, fweimer, gregory.p.smith, methane, nascheme, pitrou, skrah, tgrigg, twouters, vstinner
Date 2019-05-22.00:09:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> It seems to me that we don't need to have the PyObject structure containing a Python float to be 16-byte aligned.  If so, could we introduce a new obmalloc API that returns memory with 8-byte alignment, for use by objects that know they don't require 16-byte alignment?  floatobject.c could use this API to avoid the 33% overhead.

PyMem_Malloc / PyObject_Malloc only have one parameter: "size". It knows nothing about the allocated structure.

bpo-18835 discussed the idea of adding a new API which accept an alignment parameter. The issue was closed because of the lack of concrete usage.

In the clang crash bpo-36618 (which decided us to fix this issue), C alignof() function was discussed:

Copy of serge-sans-paille's comment:

"@vstinner: once you have a portable version of alignof, you can deciding to *not* use the pool allocator if the required alignment is greater than 8B, or you could modify the pool allocator to take alignment information as an extra parameter?"
Date User Action Args
2019-05-22 00:09:17vstinnersetrecipients: + vstinner, twouters, nascheme, gregory.p.smith, pitrou, benjamin.peterson, methane, skrah, fweimer, tgrigg
2019-05-22 00:09:17vstinnersetmessageid: <>
2019-05-22 00:09:17vstinnerlinkissue27987 messages
2019-05-22 00:09:17vstinnercreate