diff options
author | Vladimir Iacob <vladimiriacobm@gmail.com> | 2019-01-06 19:04:18 +0200 |
---|---|---|
committer | Vladimir Iacob <vladimiriacobm@gmail.com> | 2019-01-06 19:05:39 +0200 |
commit | 8a615fc8802bd25e449dc69d37df15fbb1807fb0 (patch) | |
tree | 77a2d3c96d58978228238f2205f3e3887f49bf5f /components/script/dom/vrframedata.rs | |
parent | 0196160551e03061027005bf4456e8eeb24e4d8b (diff) | |
download | servo-8a615fc8802bd25e449dc69d37df15fbb1807fb0.tar.gz servo-8a615fc8802bd25e449dc69d37df15fbb1807fb0.zip |
mark create_type_array as unsafe in vrframedata component
Diffstat (limited to 'components/script/dom/vrframedata.rs')
-rw-r--r-- | components/script/dom/vrframedata.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/components/script/dom/vrframedata.rs b/components/script/dom/vrframedata.rs index ebd0c8cc24f..08acd74bb42 100644 --- a/components/script/dom/vrframedata.rs +++ b/components/script/dom/vrframedata.rs @@ -58,10 +58,12 @@ impl VRFrameData { VRFrameDataBinding::Wrap, ); let cx = global.get_cx(); - create_typed_array(cx, &matrix, &root.left_proj); - create_typed_array(cx, &matrix, &root.left_view); - create_typed_array(cx, &matrix, &root.right_proj); - create_typed_array(cx, &matrix, &root.right_view); + unsafe { + create_typed_array(cx, &matrix, &root.left_proj); + create_typed_array(cx, &matrix, &root.left_view); + create_typed_array(cx, &matrix, &root.right_proj); + create_typed_array(cx, &matrix, &root.right_view); + } root } @@ -73,11 +75,9 @@ impl VRFrameData { /// FIXME(#22526) this should be in a better place #[allow(unsafe_code)] -pub fn create_typed_array(cx: *mut JSContext, src: &[f32], dst: &Heap<*mut JSObject>) { +pub unsafe fn create_typed_array(cx: *mut JSContext, src: &[f32], dst: &Heap<*mut JSObject>) { rooted!(in (cx) let mut array = ptr::null_mut::<JSObject>()); - unsafe { - let _ = Float32Array::create(cx, CreateWith::Slice(src), array.handle_mut()); - } + let _ = Float32Array::create(cx, CreateWith::Slice(src), array.handle_mut()); (*dst).set(array.get()); } |