Skip to content

Commit

Permalink
snmalloc to benefits from recent fixes. (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
devnexen authored Nov 16, 2024
1 parent 95fd6ce commit 743c672
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macos-13, macos-14, ubuntu-latest]
os: [windows-latest, macos-14, macos-15, ubuntu-latest]
rust: [stable, nightly]
steps:
- uses: actions-rs/toolchain@v1
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ check = ["snmalloc-sys/check"]
lto = ["snmalloc-sys/lto"]
notls = ["snmalloc-sys/notls"]
stats = ["snmalloc-sys/stats"]
#nowait-on-target = ["snmalloc-sys/nowait-on-target"]
1 change: 1 addition & 0 deletions snmalloc-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ check = []
lto = []
notls = []
stats = []
#usewait-on-target = []
12 changes: 12 additions & 0 deletions snmalloc-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ fn main() {
build.define("SNMALLOC_ENABLE_DYNAMIC_LOADING", "ON");
}

if cfg!(feature = "usewait-on-address") {
build.define("SNMALLOC_USE_WAIT_ON_ADDRESS", "1");
} else {
build.define("SNMALLOC_USE_WAIT_ON_ADDRESS", "0");
}

build.compile(target);

if target_env == "msvc" {
Expand Down Expand Up @@ -245,6 +251,12 @@ fn main() {
cfg = cfg.define("SNMALLOC_QEMU_WORKAROUND", "ON")
}

if cfg!(feature = "usewait-on-address") {
cfg = cfg.define("SNMALLOC_USE_WAIT_ON_ADDRESS", "1")
} else {
cfg = cfg.define("SNMALLOC_USE_WAIT_ON_ADDRESS", "0")
}

let mut dst = cfg.build_target(target).build();

dst.push("./build");
Expand Down

0 comments on commit 743c672

Please sign in to comment.