Skip to content

Commit f33d1c3

Browse files
committed
hum
1 parent 238b156 commit f33d1c3

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

crates/ark/src/interface.rs

-11
Original file line numberDiff line numberDiff line change
@@ -369,17 +369,6 @@ impl RMain {
369369
panic!("not testing");
370370
}
371371

372-
// In tests R may be run from various threads. This confuses R's stack
373-
// overflow checks so we disable those. This should not make it in
374-
// production builds as it causes stack overflows to crash R instead of
375-
// throwing an R error.
376-
if harp::test::IS_TESTING {
377-
panic!("testing");
378-
unsafe {
379-
libr::set(libr::R_CStackLimit, usize::MAX);
380-
}
381-
}
382-
383372
crate::sys::interface::setup_r(args);
384373

385374
libraries.initialize_post_setup_r();

crates/ark/src/sys/unix/interface.rs

+10
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,16 @@ pub fn setup_r(mut args: Vec<*mut c_char>) {
6868
libr::set(ptr_R_Busy, Some(r_busy));
6969
libr::set(ptr_R_Suicide, Some(r_suicide));
7070

71+
// In tests R may be run from various threads. This confuses R's stack
72+
// overflow checks so we disable those. This should not make it in
73+
// production builds as it causes stack overflows to crash R instead of
74+
// throwing an R error.
75+
if harp::test::IS_TESTING {
76+
unsafe {
77+
libr::set(libr::R_CStackLimit, usize::MAX);
78+
}
79+
}
80+
7181
// Set up main loop
7282
setup_Rmainloop();
7383
}

0 commit comments

Comments
 (0)