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

Implement scala.scalanative.annotation.align annotation, replacement for JVM @Contended #3365

Merged

Conversation

WojciechMazur
Copy link
Contributor

Resolves #3359

Implements new public annotation allowing to modify alignment of the fields. It is source-compatible with the JVM Contaned annotation, and have similar characteristics. @align(size: Int, group: String) takes the fixed size of alignment in bytes and group name allowing to coalate fields. When size is not passed or when pointing to scalanative.meta.LinktimeInfo.contendedPaddingWidth it would use linktime resolved value instead (default to 64 bytes, the most popular cache line size on modern architectures). This allows to use it as a direct replecment for Contended, which cannot be implemented in Scala Native directly.

@WojciechMazur WojciechMazur merged commit d24d3fb into scala-native:main Jul 5, 2023
77 checks passed
@WojciechMazur WojciechMazur deleted the feature/fields-alignment branch July 5, 2023 12:13
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.

Add annotation similar to @jdk.internal.vm.annotation.Contended
1 participant