Skip to content

Conversation

@Azoy
Copy link
Contributor

@Azoy Azoy commented Jan 31, 2024

This patch marks some global variables in the standard library as nonisolated(unsafe) where appropriate with some justification on why marking them that way is _ok_. I've also gone ahead and marked the empty singletons as const and the hashing parameters as const. C/C++ won't put just a regular const in some read only memory, so I forced these special variables in constant relocatable memory instead (because they have pointers to metadata) which will cause a bad access when trying to write to these symbols.

With -strict-concurrency=complete, this cleans up most of the warnings we have in the standard library. The only other warning we get is with CommandLine.arguments which I'm hoping we can revive this PR #69981 to deprecate and eventually move to a safer interface for this API.

@Azoy Azoy requested review from hborla and ktoso January 31, 2024 23:09
@Azoy Azoy requested a review from a team as a code owner January 31, 2024 23:09
@Azoy
Copy link
Contributor Author

Azoy commented Jan 31, 2024

@swift-ci please test

@Azoy
Copy link
Contributor Author

Azoy commented May 7, 2024

@swift-ci please smoke test

@Azoy Azoy force-pushed the constify-stdlib branch from 5a609db to 316eb4b Compare May 8, 2024 16:47
@Azoy
Copy link
Contributor Author

Azoy commented May 8, 2024

@swift-ci please test

2 similar comments
@Azoy
Copy link
Contributor Author

Azoy commented May 15, 2024

@swift-ci please test

@Azoy
Copy link
Contributor Author

Azoy commented May 29, 2024

@swift-ci please test

@Azoy
Copy link
Contributor Author

Azoy commented Jun 4, 2024

@swift-ci please test Linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants