Skip to content

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

@nicoburns

Description

@nicoburns

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions