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

Enable zero-allocation conversion between Atom's from different static atom sets #293

Open
nicoburns opened this issue Feb 21, 2025 · 0 comments

Comments

@nicoburns
Copy link

It would be useful to be able to cheaply convert between an Atom<StyloAtomSet>, an Atom<ServoAtomSet>, a DefaultAtom, etc. This would allow for interop between different crates without a performance penalty and without them all needing to coordinate on which set of static atoms to use.

However currently a dynamically allocated Atom is keyed by it's hash and that hash varies between static atom sets. So converting between Atom types requires reallocating.

I believe that implementing this would involve changing the Hash implementation of Atom to hash the content of the Atom rather than 64 bit value (see also #224 for why this may be a good anyway). At which point

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

No branches or pull requests

1 participant