From db6107dd6d90c6148d68fcd1138b8b521bdbbd45 Mon Sep 17 00:00:00 2001 From: Danny Lin Date: Tue, 9 Mar 2021 14:39:13 -0800 Subject: mimalloc: Hide C++ STL allocator implementation on Android When mimalloc is used as the system allocator and compiled as part of Bionic libc on Android, this header is included in C++ code without the STL. Hide the std::allocator interface to fix the build errors. Change-Id: I2f26844296911547b407ed39e2f345d49471fa17 --- include/mimalloc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/mimalloc.h') diff --git a/include/mimalloc.h b/include/mimalloc.h index c752ac2..c69e4c5 100644 --- a/include/mimalloc.h +++ b/include/mimalloc.h @@ -397,7 +397,7 @@ mi_decl_nodiscard mi_decl_export void* mi_new_reallocn(void* p, size_t newcount, // Implement the C++ std::allocator interface for use in STL containers. // (note: see `mimalloc-new-delete.h` for overriding the new/delete operators globally) // --------------------------------------------------------------------------------------------- -#ifdef __cplusplus +#if defined(__cplusplus) && !defined(ANDROID) #include // std::size_t #include // PTRDIFF_MAX -- cgit v1.2.3