Skip to content

Commit f310545

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 efc121b commit f310545

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
@@ -554,16 +554,7 @@ extern
554554
C
555555
"
556556
void
557-
install_rust_panic_hook
558-
(
559-
)
560-
;
561-
extern
562-
"
563-
C
564-
"
565-
void
566-
install_rust_oom_hook
557+
install_rust_hooks
567558
(
568559
)
569560
;
@@ -658,11 +649,7 @@ Initializing
658649
#
659650
ifdef
660651
JS_STANDALONE
661-
install_rust_panic_hook
662-
(
663-
)
664-
;
665-
install_rust_oom_hook
652+
install_rust_hooks
666653
(
667654
)
668655
;

mozglue/static/rust/build.rs

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,30 @@ parse
151151
"
152152
1
153153
.
154-
69
154+
71
155+
.
156+
0
157+
-
158+
alpha
159+
"
160+
)
161+
.
162+
unwrap
163+
(
164+
)
165+
;
166+
let
167+
max_alloc_error_panic_version
168+
=
169+
Version
170+
:
171+
:
172+
parse
173+
(
174+
"
175+
1
176+
.
177+
72
155178
.
156179
0
157180
-
@@ -191,6 +214,33 @@ oom_with_hook
191214
}
192215
else
193216
if
217+
ver
218+
<
219+
max_alloc_error_panic_version
220+
{
221+
println
222+
!
223+
(
224+
"
225+
cargo
226+
:
227+
rustc
228+
-
229+
cfg
230+
=
231+
feature
232+
=
233+
\
234+
"
235+
oom_with_alloc_error_panic
236+
\
237+
"
238+
"
239+
)
240+
;
241+
}
242+
else
243+
if
194244
std
195245
:
196246
:
@@ -238,7 +288,7 @@ have
238288
{
239289
}
240290
"
241-
max_oom_hook_version
291+
max_alloc_error_panic_version
242292
ver
243293
)
244294
;

0 commit comments

Comments
 (0)