`<xmemory>`: Consider updating the overalignment for large allocations
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 11.1k
- Forks
- 1.7k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 22
Description
In the _Allocate function (the backend used by std::allocator::allocate):
we have some magic to manually overalign "large" allocations:
with the goal of helping compilers to effectively autovectorize. The current value of _Big_allocation_alignment is 32:
https://github.com/microsoft/STL/blob/d6f9987d7ec694b8599fe21e87e3653c36566223/stl/inc/xmemory#L108
which is an excellent choice for SSE and AVX, but it appears that AVX512 would prefer 64-byte alignment. See the discussion in #2104. We should consider "bumping" the value of _Big_allocation_alignment in vNext to better accommodate future processors.
vNext note: Resolving this issue will require breaking binary compatibility. We won't be able to accept pull requests for this issue until the vNext branch is available. See #169 for more information.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the _Allocate function and _Big_allocation_alignment in stl/inc/xmemory, then read the discussion in #2104 and the vNext guidance in #169. Evaluate the alignment choice for future processors, accounting for the stated binary-compatibility constraint; the issue is done when an agreed vNext change is specified and validated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100