Bug 1469766 - Update OOM hook on rustc 1.28 after rust PR 51543. r?froydnj draft
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 20 Jun 2018 13:44:10 +0900
changeset 808620 8ab432534ca6fdc0eaa036f5c3a07261d581ed1d
parent 808619 eaa914a76a16fbc1a6d1cd437b4a55a1ae53732c
push id113441
push userbmo:mh+mozilla@glandium.org
push dateWed, 20 Jun 2018 06:53:04 +0000
reviewersfroydnj
bugs1469766, 51543
milestone62.0a1
Bug 1469766 - Update OOM hook on rustc 1.28 after rust PR 51543. r?froydnj
taskcluster/ci/toolchain/linux.yml
toolkit/library/rust/shared/lib.rs
--- a/taskcluster/ci/toolchain/linux.yml
+++ b/taskcluster/ci/toolchain/linux.yml
@@ -426,17 +426,17 @@ linux64-rust-nightly:
     worker:
         max-run-time: 7200
         env:
             UPLOAD_DIR: artifacts
     run:
         using: toolchain-script
         script: repack_rust.py
         arguments: [
-            '--channel', 'nightly-2018-06-13',
+            '--channel', 'nightly-2018-06-20',
             '--host', 'x86_64-unknown-linux-gnu',
             '--target', 'x86_64-unknown-linux-gnu',
             '--target', 'i686-unknown-linux-gnu',
         ]
         toolchain-artifact: public/build/rustc.tar.xz
 
 linux64-rust-macos-1.24:
     description: "rust repack with macos-cross support"
--- a/toolkit/library/rust/shared/lib.rs
+++ b/toolkit/library/rust/shared/lib.rs
@@ -1,15 +1,15 @@
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #![cfg_attr(feature = "oom_with_global_alloc",
             feature(global_allocator, alloc, alloc_system, allocator_api))]
-#![cfg_attr(feature = "oom_with_hook", feature(oom_hook))]
+#![cfg_attr(feature = "oom_with_hook", feature(alloc_error_hook))]
 
 #[cfg(feature="servo")]
 extern crate geckoservo;
 
 extern crate mp4parse_capi;
 extern crate nsstring;
 extern crate nserror;
 extern crate xpcom;
@@ -217,30 +217,30 @@ mod global_alloc {
 }
 
 #[cfg(feature = "oom_with_global_alloc")]
 #[global_allocator]
 static HEAP: global_alloc::GeckoHeap = global_alloc::GeckoHeap;
 
 #[cfg(feature = "oom_with_hook")]
 mod oom_hook {
-    use std::alloc::{Layout, set_oom_hook};
+    use std::alloc::{Layout, set_alloc_error_hook};
 
     extern "C" {
         fn GeckoHandleOOM(size: usize) -> !;
     }
 
     pub fn hook(layout: Layout) {
         unsafe {
             GeckoHandleOOM(layout.size());
         }
     }
 
     pub fn install() {
-        set_oom_hook(hook);
+        set_alloc_error_hook(hook);
     }
 }
 
 #[no_mangle]
 pub extern "C" fn install_rust_oom_hook() {
     #[cfg(feature = "oom_with_hook")]
     oom_hook::install();
 }