Author njs
Recipients neologix, njs, pitrou, rhettinger, tim.peters, vstinner
Date 2014-12-05.22:43:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1417819388.53.0.882788594746.issue18835@psf.upfronthosting.co.za>
In-reply-to
Content
Re: msg232219: If you go down the route of adding both aligned_malloc and aligned_free to the Allocator structure, I think you might as well support it for all domains? For the PyMem and PyObject domains you can just literally set the default functions to be PyMem_RawAlignedMalloc and PyMem_RawAlignedFree, and that leaves the door open to fancier implementations in the future (e.g. if PyMalloc starts implementing aligned allocation directly).

Re: msg232222: Currently all the domains share the same vtable struct, though, whereas aligned allocator functions have different signatures. So you can't literally just add an entry to the existing domain enum and be done.

It also occurs to me that if numpy ever gets serious about using aligned memory then we might also need aligned_realloc (numpy allows arrays to be resized, sigh), which is possible to do but I *cannot* recommend python attempt to provide as a standard interface. (It's not available at all in POSIX.) I guess this is another argument that it might be best to just give numpy an escape valve and worry about CPython's internal needs separately.
History
Date User Action Args
2014-12-05 22:43:08njssetrecipients: + njs, tim.peters, rhettinger, pitrou, vstinner, neologix
2014-12-05 22:43:08njssetmessageid: <1417819388.53.0.882788594746.issue18835@psf.upfronthosting.co.za>
2014-12-05 22:43:08njslinkissue18835 messages
2014-12-05 22:43:08njscreate