[issue18835] Add PyMem_AlignedAlloc()

2019-08-19 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +15052 pull_request: https://github.com/python/cpython/pull/15333 ___ Python tracker ___

[issue18835] Add PyMem_AlignedAlloc()

2017-11-23 Thread STINNER Victor
STINNER Victor added the comment: Because of the lack of strong motivition compared to the size of the change and the cost to maintain it, I reject this issue. For the archives, I attach a copy of the latest version of my implementation. -- resolution: ->

[issue18835] Add PyMem_AlignedAlloc()

2017-11-03 Thread Stefan Krah
Stefan Krah added the comment: > I'm not sure that the cost of the memory allocator itself defeats the gain of > aligned memory on algorithms. I expect data processing to be much more > expensive than the memory allocation, no? I guess this issue isn't easy to focus due

[issue18835] Add PyMem_AlignedAlloc()

2017-11-02 Thread STINNER Victor
STINNER Victor added the comment: 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

[issue18835] Add PyMem_AlignedAlloc()

2017-11-02 Thread STINNER Victor
STINNER Victor added the comment: "C11 aligned_alloc() / free() would be more comfortable but isn't available on MSVC." Is it common to require the allocated memory block to be filled with zeros? In Python, calloc() is not the most common allocator. I only found 5

[issue18835] Add PyMem_AlignedAlloc()

2017-11-01 Thread Stefan Krah
Stefan Krah added the comment: Yes, it may be better not to add it. To summarize the problems again: - C11 aligned_alloc() / free() would be more comfortable but isn't available on MSVC. - posix_memalign() performance isn't that

[issue18835] Add PyMem_AlignedAlloc()

2017-11-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: I agree, if the two primary users say they won't use it, it doesn't make sense for us to maintain 600 hundred lines of low-level C code. -- ___ Python tracker

[issue18835] Add PyMem_AlignedAlloc()

2017-10-31 Thread STINNER Victor
STINNER Victor added the comment: msg196194: Antoine Pitrou: "Note that the current small object allocator, if not disabled, *should* already return you aligned memory, by construction (each allocation size has dedicated pools from which memory blocks are carved)."

[issue18835] Add PyMem_AlignedAlloc()

2017-10-31 Thread STINNER Victor
Change by STINNER Victor : -- title: Add aligned memory variants to the suite of PyMem functions/macros -> Add PyMem_AlignedAlloc() ___ Python tracker