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

fix issue 16597 - deprecate shared as associative array storage class #9366

Closed
wants to merge 2 commits into from
Closed

fix issue 16597 - deprecate shared as associative array storage class #9366

wants to merge 2 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Feb 16, 2019

It's not possible to output directly an error because in theory it would be possible that someone uses a shared AA in combination with synchronization barriers, so instead encourage using __gshared.

@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @Basile-z! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the annotated coverage diff directly on GitHub with CodeCov's browser extension
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Auto-close Bugzilla Severity Description
16597 major Initializing a shared hashmap segfaults

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub fetch digger
dub run digger -- build "master + dmd#9366"

changelog/osx-32bit.dd Outdated Show resolved Hide resolved
@jacob-carlborg
Copy link
Contributor

Is this in the spec?

@ghost
Copy link
Author

ghost commented Feb 16, 2019

Not to my knowledge. To be perfectly honest, this PR is naively motivated by a comment in the issue.
The idea is just to avoid head scratching for the people trying to do something that cant work.

src/dmd/dsymbolsem.d Outdated Show resolved Hide resolved
*/
// https://issues.dlang.org/show_bug.cgi?id=16597
shared int[int] aa1;
shared(int[int]) aa2;
Copy link
Member

Choose a reason for hiding this comment

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

We should probably also disallow shared(V)[K], as I don't think the AA implementation takes any precautions to guard reads/writes of shared values. Can you add a test for this as well?

Co-Authored-By: Basile-z <16154339+Basile-z@users.noreply.github.com>
@ghost
Copy link
Author

ghost commented Feb 19, 2019

Sorry i don't feel it anymore. I keep the branch if some one wants to polish and is more convinced about the validity of this restriction.

@ghost ghost closed this Feb 19, 2019
@wilzbach wilzbach added the Review:Phantom Zone Has value/information for future work, but closed for now label Feb 19, 2019
@ghost ghost deleted the issue-16597 branch March 31, 2019 12:53
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Review:Phantom Zone Has value/information for future work, but closed for now Severity:Bug Fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants