Bug 1519629 - Document a few more macros. a=jorgk DONTBUILD THUNDERBIRD_60_VERBRANCH
authorEmilio Cobos Alvarez <emilio@crisal.io>
Sun, 13 Jan 2019 21:42:38 +0100
branchTHUNDERBIRD_60_VERBRANCH
changeset 451256 eb76765892cfd646d3014e5f3b8df8c6753da2d2
parent 451255 04a9bb38c3a5c8bc73046be7bf8d70e37de19c56
child 451302 83976e91b33c240da4297e8b05199f5004bdf879
push id458
push usermozilla@jorgk.com
push dateWed, 03 Jul 2019 07:01:58 +0000
treeherdermozilla-esr60@eb76765892cf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorgk
bugs1519629
milestone60.8.0
Bug 1519629 - Document a few more macros. a=jorgk DONTBUILD
servo/components/style/gecko/regen_atoms.py
servo/components/style/gecko_string_cache/namespace.rs
--- a/servo/components/style/gecko/regen_atoms.py
+++ b/servo/components/style/gecko/regen_atoms.py
@@ -197,16 +197,17 @@ cfg_if! {{
 RULE_TEMPLATE = ('("{atom}") =>\n  '
                  '{{{{ '
                  '#[allow(unsafe_code)] #[allow(unused_unsafe)]'
                  'unsafe {{ $crate::string_cache::atom_macro::atom_from_static'
                  '($crate::string_cache::atom_macro::{name} as *mut _) }}'
                  ' }}}};')
 
 MACRO = '''
+/// Returns a static atom by passing the literal string it represents.
 #[macro_export]
 macro_rules! atom {{
 {}
 }}
 '''
 
 
 def write_atom_macro(atoms, file_name):
--- a/servo/components/style/gecko_string_cache/namespace.rs
+++ b/servo/components/style/gecko_string_cache/namespace.rs
@@ -6,16 +6,18 @@
 
 use gecko_bindings::structs::nsAtom;
 use precomputed_hash::PrecomputedHash;
 use std::borrow::Borrow;
 use std::fmt;
 use std::ops::Deref;
 use string_cache::{Atom, WeakAtom};
 
+/// In Gecko namespaces are just regular atoms, so this is a simple macro to
+/// forward one macro to the other.
 #[macro_export]
 macro_rules! ns {
     () => { $crate::string_cache::Namespace(atom!("")) };
     ($s: tt) => { $crate::string_cache::Namespace(atom!($s)) };
 }
 
 /// A Gecko namespace is just a wrapped atom.
 #[derive(Clone, Debug, Default, Eq, Hash, MallocSizeOf, PartialEq)]