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

deprecate aligned_storage #1394

Closed

Conversation

blonded04
Copy link
Contributor

Description

Removed deprecated aligned_storage_t from tbb

Fixes #1253

Type of change

Choose one or multiple, leave empty if none of the other choices apply

Add a respective label(s) to PR if you have permissions

  • bug fix - change that fixes an issue
  • new feature - change that adds functionality
  • tests - change in tests
  • infrastructure - change in infrastructure and CI
  • documentation - documentation update

Tests

  • added - required for new features and some bug fixes
  • not needed

Documentation

  • updated in # - add PR number
  • needs to be updated
  • not needed

Breaks backward compatibility

  • Yes
  • No
  • Unknown

Notify the following users

List users with @ to send notifications

Other information

Signed-off-by: Valery Matskevich <generalretcher@gmail.com>
@dnmokhov dnmokhov requested a review from kboyarinov June 10, 2024 21:37
@blonded04
Copy link
Contributor Author

Hello @kboyarinov ! Can you please review it?

Signed-off-by: Valery Matskevich <generalretcher@gmail.com>
Copy link
Contributor

@kboyarinov kboyarinov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@blonded04,

Sorry for taking so long to review this. I am OK with the idea of the change.

But the problem is that for the previous implementation, the second argument for std::aligned_storage was missed and hence the my_value field alignment can change if the change would be applied that results in a breaking change (consider the use-case when the container is passed between the border of the translation units built with different oneTBB versions).
To protect the user from this, we need to update the implementation version for all of the concurrent unordered containers by changing the internal namespace number. Currently it is d1. For this change, we need to update it to d2. Could you please do it as part of this PR to make it possible to merge it?

@@ -179,8 +179,7 @@ class value_node : public list_node<SokeyType>
}

private:
using aligned_storage_type = typename std::aligned_storage<sizeof(value_type)>::type;
aligned_storage_type my_value;
alignas(value_type) alignas(max_nfs_size) char my_value[sizeof(value_type)];
Copy link
Contributor

@kboyarinov kboyarinov Jul 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be consistent with other containers:

Suggested change
alignas(value_type) alignas(max_nfs_size) char my_value[sizeof(value_type)];
union {
value_type my_value;
}

May be some usage lines should be changed accordingly as well.

@blonded04
Copy link
Contributor Author

@blonded04,

Sorry for taking so long to review this. I am OK with the idea of the change.

But the problem is that for the previous implementation, the second argument for std::aligned_storage was missed and hence the my_value field alignment can change if the change would be applied that results in a breaking change (consider the use-case when the container is passed between the border of the translation units built with different oneTBB versions). To protect the user from this, we need to update the implementation version for all of the concurrent unordered containers by changing the internal namespace number. Currently it is d1. For this change, we need to update it to d2. Could you please do it as part of this PR to make it possible to merge it?

Thanks for review. I'll finish this PR on this weekend.

@blonded04
Copy link
Contributor Author

@blonded04,
Sorry for taking so long to review this. I am OK with the idea of the change.
But the problem is that for the previous implementation, the second argument for std::aligned_storage was missed and hence the my_value field alignment can change if the change would be applied that results in a breaking change (consider the use-case when the container is passed between the border of the translation units built with different oneTBB versions). To protect the user from this, we need to update the implementation version for all of the concurrent unordered containers by changing the internal namespace number. Currently it is d1. For this change, we need to update it to d2. Could you please do it as part of this PR to make it possible to merge it?

Thanks for review. I'll finish this PR on this weekend.

next weekend* sorry

@kboyarinov
Copy link
Contributor

@blonded04, I have finalized your PR to fit with our release schedule.
The PR was merged to master today.
Many thanks for working on this fix.

@kboyarinov kboyarinov closed this Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

std::aligned_storage is deprecated in C++23 and should not be used anymore
3 participants