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