Skip to content

Commit

Permalink
Skip mimalloc on Windows aarch64 (#1279)
Browse files Browse the repository at this point in the history
This adjusts the conditional compilation to skip mimalloc on Windows
aarch64 in addition to WASM, where cross-compilation needs some extra
work.
  • Loading branch information
swernli authored Mar 20, 2024
1 parent bbd2cfb commit 05ba7e4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion allocator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition.workspace = true
license.workspace = true
version.workspace = true

[target.'cfg(not(target_family = "wasm"))'.dependencies]
[target.'cfg(not(any(target_family = "wasm", all(target_family = "windows", target_arch = "aarch64"))))'.dependencies]
mimalloc-sys = { path = "./mimalloc-sys" }

[lints]
Expand Down
10 changes: 8 additions & 2 deletions allocator/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#[cfg(not(target_family = "wasm"))]
#[cfg(not(any(
target_family = "wasm",
all(target_family = "windows", target_arch = "aarch64")
)))]
pub mod mimalloc;

/// Declare a global allocator if the platform supports it.
#[macro_export]
macro_rules! assign_global {
() => {
#[cfg(not(target_family = "wasm"))]
#[cfg(not(any(
target_family = "wasm",
all(target_family = "windows", target_arch = "aarch64")
)))]
#[global_allocator]
static GLOBAL: allocator::mimalloc::Mimalloc = allocator::mimalloc::Mimalloc;
};
Expand Down

0 comments on commit 05ba7e4

Please sign in to comment.