Message343134
> 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:
https://bugs.python.org/issue36618#msg340279
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:17 | vstinner | set | recipients:
+ vstinner, twouters, nascheme, gregory.p.smith, pitrou, benjamin.peterson, methane, skrah, fweimer, tgrigg |
2019-05-22 00:09:17 | vstinner | set | messageid: <1558483757.34.0.114918637339.issue27987@roundup.psfhosted.org> |
2019-05-22 00:09:17 | vstinner | link | issue27987 messages |
2019-05-22 00:09:17 | vstinner | create | |
|