Message196174
Currently, we have little to no control over the alignment of memory returned by the PyMem functions.
I suggest variants such as PyMem_Alloc32(n) and PyMem_Alloc64(n) to return suitably aligned data blocks.
GNU C provides memalign() for this purpose: http://www.delorie.com/gnu/docs/glibc/libc_31.html
and the Microsoft C compiler has _aligned_malloc() for the same purpose: http://msdn.microsoft.com/en-us/library/8z34s9c6%28VS.80%29.aspx
A principal use case would be PyObject pointers where we want to keep all or most of the data fields in the same cache line (i.e. the fields for list, tuple, dict, and set objects).
Deques would benefit from having the deque blocks aligned to 64byte boundaries and never crossing page boundaries. Set entries would benefit from 32byte alignment. |
|
Date |
User |
Action |
Args |
2013-08-26 02:32:51 | rhettinger | set | recipients:
+ rhettinger |
2013-08-26 02:32:51 | rhettinger | set | messageid: <1377484371.18.0.399621580043.issue18835@psf.upfronthosting.co.za> |
2013-08-26 02:32:51 | rhettinger | link | issue18835 messages |
2013-08-26 02:32:50 | rhettinger | create | |
|