Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<cstdlib>: missing std::aligned_alloc function. #2176

Closed
B1aNB1aN opened this issue Sep 1, 2021 · 2 comments
Closed

<cstdlib>: missing std::aligned_alloc function. #2176

B1aNB1aN opened this issue Sep 1, 2021 · 2 comments
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@B1aNB1aN
Copy link

B1aNB1aN commented Sep 1, 2021

Describe the bug
std::aligned_alloc is added to c++ standard at c++17 standard. Is there any plan to implement this function?

@fsb4000
Copy link
Contributor

fsb4000 commented Sep 1, 2021

No, as far as I know.

(Reasons: https://docs.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance?view=msvc-160#note_M )

Use _aligned_malloc and _aligned_free

https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/aligned-malloc?view=msvc-160

I think I asked Stephan about it in 2016 year.

That was our first conversation at comments section of https://devblogs.microsoft.com/cppblog/

😊

@CaseyCarter CaseyCarter added bug Something isn't working wontfix This will not be worked on labels Sep 1, 2021
@CaseyCarter
Copy link
Member

@fsb4000 has it right. Windows supports aligned allocation, but those allocations can't be deallocated by free, so there's no way to support aligned_alloc without major destabilizing changes. Windows folk have expressed to us a distinct lack of interest in making such changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants