Skip to content

Commit ce361d2

Browse files
kdrag0nGelbpunkt
authored andcommitted
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.
1 parent cacb387 commit ce361d2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/mimalloc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ mi_decl_nodiscard mi_decl_export void* mi_new_reallocn(void* p, size_t newcount,
397397
// Implement the C++ std::allocator interface for use in STL containers.
398398
// (note: see `mimalloc-new-delete.h` for overriding the new/delete operators globally)
399399
// ---------------------------------------------------------------------------------------------
400-
#ifdef __cplusplus
400+
#if defined(__cplusplus) && !defined(ANDROID)
401401

402402
#include <cstddef> // std::size_t
403403
#include <cstdint> // PTRDIFF_MAX

0 commit comments

Comments
 (0)