stylo: We've had bitfield accessors for a while now. draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Tue, 08 Aug 2017 17:33:51 +0200
changeset 642665 3138eb914fba13d7840f14f196e2f8193a7a39ac
parent 642664 db89f7a04750586f7bd99000079f0647c7b7659c
child 642666 23429126a505e2f385959f3fb574a84dd7074749
child 642839 f7722fa68232e558ffc89d3f51ceba9d57515da0
push id72833
push userbmo:emilio+bugs@crisal.io
push dateTue, 08 Aug 2017 16:50:16 +0000
milestone57.0a1
stylo: We've had bitfield accessors for a while now.
servo/components/style/gecko_string_cache/mod.rs
--- a/servo/components/style/gecko_string_cache/mod.rs
+++ b/servo/components/style/gecko_string_cache/mod.rs
@@ -151,21 +151,18 @@ impl WeakAtom {
         unsafe {
             (*self.as_ptr()).mIsStatic() != 0
         }
     }
 
     /// Returns the length of the atom string.
     #[inline]
     pub fn len(&self) -> u32 {
-        // FIXME(emilio): re-introduce bitfield accessors:
-        //
-        // https://github.com/servo/rust-bindgen/issues/519
         unsafe {
-            (*self.as_ptr())._bitfield_1 & 0x7FFFFFFF
+            (*self.as_ptr()).mLength()
         }
     }
 
     /// Returns whether this atom is the empty string.
     #[inline]
     pub fn is_empty(&self) -> bool {
         self.len() == 0
     }