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

Adding in unintern function #1828

Merged
merged 2 commits into from
Oct 22, 2019
Merged

Conversation

Pauan
Copy link
Contributor

@Pauan Pauan commented Oct 22, 2019

See #1386 (comment) for an example use-case for this.

@alexcrichton alexcrichton merged commit c1b4f67 into rustwasm:master Oct 22, 2019
@alexcrichton
Copy link
Contributor

👍

@Pauan Pauan deleted the intern-cache-remove branch October 22, 2019 22:50
@@ -40,6 +40,14 @@ cfg_if! {
}
})
}

fn unintern_str(key: &str) {
Copy link
Member

Choose a reason for hiding this comment

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

Should we have some sort of reference counter perhaps? That is, if several parts of code use intern, but then one does unintern, maybe we shouldn't evict it yet?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I figured that if you want that, it's easy enough to do your own ref-counting in your program.

I'm a bit wary of introducing too much complexity, it seems to me that ref-counting is orthogonal to interning.

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.

None yet

3 participants