Bug 1469766 - Update OOM hook on rustc 1.28 after rust PR 51543. r=froydnj
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 20 Jun 2018 13:44:10 +0900
changeset 479853 11018f20ca8dbeef5e71a4a67882d9b51ee90c03
parent 479852 5cc046f4654100da7d01a0e44aa069331860f784
child 479854 7b5b59d44cead15900cdc4e79c7657cc11be5349
push id1757
push userffxbld-merge
push dateFri, 24 Aug 2018 17:02:43 +0000
treeherdermozilla-release@736023aebdb1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1469766, 51543
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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();
 }