summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominic Chen <ddchen@apple.com>2022-04-19 01:56:06 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-04-19 01:56:06 +0000
commit81d0a55e20eed47e6e0fb68b2d4b16a15fd897c2 (patch)
treef3985d2ab16f1dc1cc871b8ca8f59d4007322deb
parent2b39cda0d97f0795cb3246b6c5d35b793fdf48b1 (diff)
parent97e42010f890799aadbd0dd6ae4583331c9706ed (diff)
downloadscudo-81d0a55e20eed47e6e0fb68b2d4b16a15fd897c2.tar.gz
[scudo] Provide allocator declaration am: be9f4b02c6 am: 6293736553 am: a45d377f08 am: 4160bd72c2 am: 97e42010f8
Original change: https://android-review.googlesource.com/c/platform/external/scudo/+/2066954 Change-Id: I0bc0e8c85065a1cb0d22dd0a0abde53af6578b36 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--standalone/wrappers_c.cpp2
-rw-r--r--standalone/wrappers_c.h5
-rw-r--r--standalone/wrappers_cpp.cpp4
3 files changed, 6 insertions, 5 deletions
diff --git a/standalone/wrappers_c.cpp b/standalone/wrappers_c.cpp
index 81c7dd60ee3..b4d51be716c 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 5f7f51f3ced..08dc679b34c 100644
--- a/standalone/wrappers_c.h
+++ b/standalone/wrappers_c.h
@@ -54,4 +54,9 @@ struct __scudo_mallinfo2 {
#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 adb10411812..16f495b6a35 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 {};