microsoft/qdk
Publicmirrored fromhttps://github.com/microsoft/qdkAvailable
allocator/src/lib.rs
21lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. |
| 2 | // Licensed under the MIT License. |
| 3 | |
| 4 | #[cfg(not(any( |
| 5 | target_family = "wasm", |
| 6 | all(target_family = "windows", target_arch = "aarch64") |
| 7 | )))] |
| 8 | pub mod mimalloc; |
| 9 | |
| 10 | /// Declare a global allocator if the platform supports it. |
| 11 | #[macro_export] |
| 12 | macro_rules! assign_global { |
| 13 | () => { |
| 14 | #[cfg(not(any( |
| 15 | target_family = "wasm", |
| 16 | all(target_family = "windows", target_arch = "aarch64") |
| 17 | )))] |
| 18 | #[global_allocator] |
| 19 | static GLOBAL: allocator::mimalloc::Mimalloc = allocator::mimalloc::Mimalloc; |
| 20 | }; |
| 21 | } |
| 22 | |