Skip to content

Don't export global allocs which are not statics #133

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

Merged
merged 1 commit into from
Feb 27, 2022

Conversation

bjorn3
Copy link
Member

@bjorn3 bjorn3 commented Feb 27, 2022

They aren't be referenced outside of the current cgu anyway. This should make optimizations a bit more effective.

They aren't be referenced outside of the current cgu anyway. This should make
optimizations a bit more effective.
@@ -170,11 +170,9 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
match kind {
Some(kind) if !self.tcx.sess.fewer_names() => {
let name = self.generate_local_symbol_name(kind);
// TODO(antoyo): check if it's okay that TLS is off here.
Copy link
Member Author

Choose a reason for hiding this comment

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

Only statics can be thread local. Allocations referenced by other allocations can't ever be thread local as a single pointer has to be used independent of the thread.

@antoyo antoyo merged commit 1a9ae8d into rust-lang:master Feb 27, 2022
@antoyo
Copy link
Contributor

antoyo commented Feb 27, 2022

Thanks!

@bjorn3 bjorn3 deleted the less_exports branch February 27, 2022 15:29
@bjorn3 bjorn3 mentioned this pull request Mar 30, 2022
3 tasks
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.

2 participants