servo: Merge #11160 - Only use zeroed memory for gecko style structs, not the wrapper servo struct (from bholley:zero_gecko_struct); r=mbrubeck
authorBobby Holley <bobbyholley@gmail.com>
Thu, 12 May 2016 11:36:42 -0700
changeset 338794 024cf852ecd84679ae02f70f88f85f76e1cb255e
parent 338793 c76d155202410cb835870130d8a6e84e73d24036
child 338795 ee070d7b4ee97f55441598bb9757a95c369cf12e
push id31307
push usergszorc@mozilla.com
push dateSat, 04 Feb 2017 00:59:06 +0000
treeherdermozilla-central@94079d43835f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmbrubeck
servo: Merge #11160 - Only use zeroed memory for gecko style structs, not the wrapper servo struct (from bholley:zero_gecko_struct); r=mbrubeck So that we don't clobber the drop flags. This is a regression from #11121. Source-Repo: https://github.com/servo/servo Source-Revision: c2beb55c0f039d096241d677fb93bfa0a3b18e56
servo/ports/geckolib/properties.mako.rs
--- a/servo/ports/geckolib/properties.mako.rs
+++ b/servo/ports/geckolib/properties.mako.rs
@@ -335,17 +335,17 @@ impl Drop for ${style_struct.gecko_struc
         unsafe {
             Gecko_Destroy_${style_struct.gecko_ffi_name}(&mut self.gecko);
         }
     }
 }
 impl Clone for ${style_struct.gecko_struct_name} {
     fn clone(&self) -> Self {
         unsafe {
-            let mut result: Self = zeroed();
+            let mut result = ${style_struct.gecko_struct_name} { gecko: zeroed() };
             Gecko_CopyConstruct_${style_struct.gecko_ffi_name}(&mut result.gecko, &self.gecko);
             result
         }
     }
 }
 
 // FIXME(bholley): Make bindgen generate Debug for all types.
 %if style_struct.gecko_ffi_name in "nsStyleBorder nsStyleDisplay nsStyleList nsStyleBackground "\