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