[scudo] Provide allocator declaration am: be9f4b02c6 am: 6293736553 am: a45d377f08
Original change: https://android-review.googlesource.com/c/platform/external/scudo/+/2066954
Change-Id: Iad69f64cc45d3577c9ab1098ea35cd20dd272b55
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/standalone/wrappers_c.cpp b/standalone/wrappers_c.cpp
index 81c7dd6..b4d51be 100644
--- a/standalone/wrappers_c.cpp
+++ b/standalone/wrappers_c.cpp
@@ -21,8 +21,6 @@
#define SCUDO_PREFIX(name) name
#define SCUDO_ALLOCATOR Allocator
-extern "C" void SCUDO_PREFIX(malloc_postinit)();
-
// Export the static allocator so that the C++ wrappers can access it.
// Technically we could have a completely separated heap for C & C++ but in
// reality the amount of cross pollination between the two is staggering.
diff --git a/standalone/wrappers_c.h b/standalone/wrappers_c.h
index 5f7f51f..08dc679 100644
--- a/standalone/wrappers_c.h
+++ b/standalone/wrappers_c.h
@@ -54,4 +54,9 @@
#define SCUDO_MALLINFO __scudo_mallinfo
#endif
+#if !SCUDO_ANDROID || !_BIONIC
+extern "C" void malloc_postinit();
+extern HIDDEN scudo::Allocator<scudo::Config, malloc_postinit> Allocator;
+#endif
+
#endif // SCUDO_WRAPPERS_C_H_
diff --git a/standalone/wrappers_cpp.cpp b/standalone/wrappers_cpp.cpp
index adb1041..16f495b 100644
--- a/standalone/wrappers_cpp.cpp
+++ b/standalone/wrappers_cpp.cpp
@@ -12,12 +12,10 @@
#if !SCUDO_ANDROID || !_BIONIC
#include "allocator_config.h"
+#include "wrappers_c.h"
#include <stdint.h>
-extern "C" void malloc_postinit();
-extern HIDDEN scudo::Allocator<scudo::Config, malloc_postinit> Allocator;
-
namespace std {
struct nothrow_t {};
enum class align_val_t : size_t {};