-
-
Notifications
You must be signed in to change notification settings - Fork 501
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
Make Atom
Copy
#8606
Comments
Boshen
referenced
this issue
Jan 19, 2025
Follow up from #8543 (comment) > I agree. https://github.com/oxc-project/backlog/issues/155 > Originally we were considering some form of interning and reference-counting, so we didn't make it Copy to leave the door open for that. But now all strings are stored in the arena anyway, so even if we did decide to intern strings, reference-counting would be irrelevant - our bump allocator doesn't allow freeing individual allocations anyway. Most of the changes are done automatically by `just fix` (`cargo clippy --fix` && `cargo fmt --all`). See the commit list for the manual edits.
Implemented in #8596. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Atom
is just a wrapper around&str
, so could beCopy
.I thought previously that we should avoid making
Atom
Copy
in case we had a future reason for them not to be, like some form of reference-counting.But now I can't see any such reason. Even if we store hash of string inside
Atom
(#46), that wouldn't preventAtom
beingCopy
.This change would remove a ton of
atom.clone()
from all over the codebase.The text was updated successfully, but these errors were encountered: