aboutsummaryrefslogtreecommitdiffstats
path: root/components/allocator/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/allocator/lib.rs')
-rw-r--r--components/allocator/lib.rs13
1 files changed, 11 insertions, 2 deletions
diff --git a/components/allocator/lib.rs b/components/allocator/lib.rs
index 20ac30e8022..a28916375df 100644
--- a/components/allocator/lib.rs
+++ b/components/allocator/lib.rs
@@ -9,7 +9,12 @@ static ALLOC: Allocator = Allocator;
pub use crate::platform::*;
-#[cfg(not(any(windows, target_os = "android", feature = "use-system-allocator")))]
+#[cfg(not(any(
+ windows,
+ target_os = "android",
+ feature = "use-system-allocator",
+ target_env = "ohos"
+)))]
mod platform {
use std::os::raw::c_void;
@@ -32,7 +37,11 @@ mod platform {
#[cfg(all(
not(windows),
- any(target_os = "android", feature = "use-system-allocator")
+ any(
+ target_os = "android",
+ feature = "use-system-allocator",
+ target_env = "ohos"
+ )
))]
mod platform {
pub use std::alloc::System as Allocator;