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.
14 lines
317 B
Rust
14 lines
317 B
Rust
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");
|
|
}
|