Use sigsetjmp instead of setjmp (#2645)
Apparently on macOS `setjmp` manipulates the process-wide signal mask which adds a good deal of overhead. We don't actually need this functionality so this commit switches to using the `sig` version of setjmp/longjmp where we can explicitly ask the signal mask to not get preserved. This came out of poking around on #2644 and on macOS locally thi sdropped the overhead from 721ns to 55ns.
This commit is contained in:
@@ -1,7 +1,13 @@
|
||||
use std::env;
|
||||
|
||||
fn main() {
|
||||
println!("cargo:rerun-if-changed=src/helpers.c");
|
||||
cc::Build::new()
|
||||
.warnings(true)
|
||||
.define(
|
||||
&format!("CFG_TARGET_OS_{}", env::var("CARGO_CFG_TARGET_OS").unwrap()),
|
||||
None,
|
||||
)
|
||||
.file("src/helpers.c")
|
||||
.compile("helpers");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user