Skip to content

Conversation

@AZero13
Copy link
Contributor

@AZero13 AZero13 commented Dec 14, 2023

aligned_alloc is the preferred way to do AlignedAlloc when we can support that, with the other code being a fallback if that is not the case.

@AZero13 AZero13 force-pushed the Task branch 5 times, most recently from 22180a0 to 24c3d7b Compare December 15, 2023 15:17
@AZero13
Copy link
Contributor Author

AZero13 commented Dec 15, 2023

@ahoppen Could you please initiate the test?

@ahoppen
Copy link
Member

ahoppen commented Dec 15, 2023

I’m not at all familiar with this code. @jckar Looks like you wrote it originally 10 years ago, could you take a look?

@ahoppen ahoppen requested a review from jckarter December 15, 2023 16:00
@AZero13 AZero13 force-pushed the Task branch 2 times, most recently from c143768 to 0ed083b Compare December 15, 2023 18:58
@AZero13
Copy link
Contributor Author

AZero13 commented Dec 15, 2023

@compnerd can we please test this

@compnerd
Copy link
Member

@AtariDreams I like the premise of the change, but I do not believe that the change is correct. The second condition for Windows needs to be changed to #elif. I would also recommend that you double check if MSVCRT supports aligned_alloc (it does support most of C11).

@AZero13
Copy link
Contributor Author

AZero13 commented Dec 15, 2023

@AtariDreams I like the premise of the change, but I do not believe that the change is correct. The second condition for Windows needs to be changed to #elif. I would also recommend that you double check if MSVCRT supports aligned_alloc (it does support most of C11).

Fixed!

@AZero13
Copy link
Contributor Author

AZero13 commented Dec 15, 2023

@AtariDreams I like the premise of the change, but I do not believe that the change is correct. The second condition for Windows needs to be changed to #elif. I would also recommend that you double check if MSVCRT supports aligned_alloc (it does support most of C11).

Just checked, and Microsoft's C runtime does not support it, so thank you.

aligned_alloc is the preferred way to do AlignedAlloc when we can support that, with the other code being a fallback if that is not the case.
@compnerd
Copy link
Member

@swift-ci please test

@compnerd
Copy link
Member

@swift-ci please benchmark

@AZero13
Copy link
Contributor Author

AZero13 commented Dec 16, 2023

@compnerd Thoughts? Things passed but benchmarks are wishy-washy

@compnerd
Copy link
Member

I think that we can run them once again to see if they are stable or just noise

@compnerd
Copy link
Member

@swift-ci please benchmark

@compnerd
Copy link
Member

FWIW, I do not expect this to impact the benchmarks in any meaningful way (if there is a bit of noise, it is likely for cache line behaviour).

@AZero13
Copy link
Contributor Author

AZero13 commented Dec 18, 2023

@compnerd benchmarks seem fine

@compnerd
Copy link
Member

Yeah, I agree, sounds like it is mostly noise. Going to merge this.

@compnerd compnerd merged commit eda8f15 into swiftlang:main Dec 18, 2023
@AZero13 AZero13 deleted the Task branch December 19, 2023 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants