Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
style: Make static atom pointers
constexpr
.
This saves one word per static atom, per process. The `nsGkAtoms` change is only a small part of this commit. In regen_atoms.py: - There is now only one link name per platform: nsGkAtoms::sAtoms[]. - But there is a new constant per atom, giving the index into nsGkAtoms::sAtoms[]. - And the `atom!` macro for each atom indexes into nsGkAtoms::sAtoms[] using the index constant. - A couple of `*mut` pointers are now `*const`. Elsewhere, the `(nsStaticAtom*)` casts within the `AppendElement()` calls are necessary to avoid link errors, presumably due to some template instantiation wrinkle. Bug: 1449787 Reviewed-by: froydnj,emilio
- Loading branch information
1 parent
c276c8a
commit 0d5d5a9
Showing
2 changed files
with
29 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters