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, neologix, njs, pitrou, rhettinger, skrah, tim.peters, trent, vstinner, wscullin, xdegaye
Date 2017-11-02.11:40:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
About the API itself, I'm not sure that PyMem_AlignedAlloc(alignment, size) is flexible enough. If we want to get *data* aligned in a Python object, we would have to pass an offset to the data, since Python objects have headers of variable size (depending on the type).

Windows has such API:

void * _aligned_offset_malloc(  
   size_t size,   
   size_t alignment,   
   size_t offset  

This function is based on malloc, so likely adds padding bytes for you depending on size, alignment and offset.

See bpo-27987: "obmalloc's 8-byte alignment causes undefined behavior".
Date User Action Args
2017-11-02 11:40:59vstinnersetrecipients: + vstinner, tim.peters, rhettinger, pitrou, benjamin.peterson, trent, njs, skrah, neologix, xdegaye, wscullin
2017-11-02 11:40:59vstinnersetmessageid: <>
2017-11-02 11:40:59vstinnerlinkissue18835 messages
2017-11-02 11:40:59vstinnercreate