Skip to content

Commit 521cd07

Browse files
committed
Bug 1829780 - Adjust our OOM hook to the new API from rustc 1.71. r=emilio
The new API landed in rust-lang/rust#109507 Differential Revision: https://phabricator.services.mozilla.com/D176383 UltraBlame original commit: 04bb12c2c8fd7036f9f2d0b85a73c6cb31b0dcf0
1 parent f54fadc commit 521cd07

File tree

4 files changed

+248
-78
lines changed

4 files changed

+248
-78
lines changed

js/src/vm/Initialization.cpp

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -830,16 +830,7 @@ extern
830830
C
831831
"
832832
void
833-
install_rust_panic_hook
834-
(
835-
)
836-
;
837-
extern
838-
"
839-
C
840-
"
841-
void
842-
install_rust_oom_hook
833+
install_rust_hooks
843834
(
844835
)
845836
;
@@ -962,11 +953,7 @@ non
962953
standalone
963954
builds
964955
.
965-
install_rust_panic_hook
966-
(
967-
)
968-
;
969-
install_rust_oom_hook
956+
install_rust_hooks
970957
(
971958
)
972959
;

mozglue/static/rust/build.rs

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,30 @@ parse
222222
"
223223
1
224224
.
225-
70
225+
71
226+
.
227+
0
228+
-
229+
alpha
230+
"
231+
)
232+
.
233+
unwrap
234+
(
235+
)
236+
;
237+
let
238+
max_alloc_error_panic_version
239+
=
240+
Version
241+
:
242+
:
243+
parse
244+
(
245+
"
246+
1
247+
.
248+
72
226249
.
227250
0
228251
-
@@ -262,6 +285,33 @@ oom_with_hook
262285
}
263286
else
264287
if
288+
ver
289+
<
290+
max_alloc_error_panic_version
291+
{
292+
println
293+
!
294+
(
295+
"
296+
cargo
297+
:
298+
rustc
299+
-
300+
cfg
301+
=
302+
feature
303+
=
304+
\
305+
"
306+
oom_with_alloc_error_panic
307+
\
308+
"
309+
"
310+
)
311+
;
312+
}
313+
else
314+
if
265315
std
266316
:
267317
:
@@ -309,7 +359,7 @@ have
309359
{
310360
}
311361
"
312-
max_oom_hook_version
362+
max_alloc_error_panic_version
313363
ver
314364
)
315365
;

0 commit comments

Comments
 (0)