Skip to content

Commit

Permalink
Bug 1829780 - Adjust our OOM hook to the new API from rustc 1.71. r=e…
Browse files Browse the repository at this point in the history
…milio

The new API landed in rust-lang/rust#109507

Differential Revision: https://phabricator.services.mozilla.com/D176383

UltraBlame original commit: 04bb12c2c8fd7036f9f2d0b85a73c6cb31b0dcf0
  • Loading branch information
marco-c committed May 1, 2023
1 parent f54fadc commit 521cd07
Show file tree
Hide file tree
Showing 4 changed files with 248 additions and 78 deletions.
17 changes: 2 additions & 15 deletions js/src/vm/Initialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -830,16 +830,7 @@ extern
C
"
void
install_rust_panic_hook
(
)
;
extern
"
C
"
void
install_rust_oom_hook
install_rust_hooks
(
)
;
Expand Down Expand Up @@ -962,11 +953,7 @@ non
standalone
builds
.
install_rust_panic_hook
(
)
;
install_rust_oom_hook
install_rust_hooks
(
)
;
Expand Down
54 changes: 52 additions & 2 deletions mozglue/static/rust/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,30 @@ parse
"
1
.
70
71
.
0
-
alpha
"
)
.
unwrap
(
)
;
let
max_alloc_error_panic_version
=
Version
:
:
parse
(
"
1
.
72
.
0
-
Expand Down Expand Up @@ -262,6 +285,33 @@ oom_with_hook
}
else
if
ver
<
max_alloc_error_panic_version
{
println
!
(
"
cargo
:
rustc
-
cfg
=
feature
=
\
"
oom_with_alloc_error_panic
\
"
"
)
;
}
else
if
std
:
:
Expand Down Expand Up @@ -309,7 +359,7 @@ have
{
}
"
max_oom_hook_version
max_alloc_error_panic_version
ver
)
;
Expand Down
Loading

0 comments on commit 521cd07

Please sign in to comment.