diff options
author | Dominic Chen <ddchen@apple.com> | 2022-04-19 01:05:30 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2022-04-19 01:05:30 +0000 |
commit | 4160bd72c25821504b7aff9d1ed2389491a54f5b (patch) | |
tree | f3985d2ab16f1dc1cc871b8ca8f59d4007322deb | |
parent | 36fcc61e374857174b17e837e5f517380ab33b3a (diff) | |
parent | a45d377f081f1c1fee33fd9e50f0111203bde214 (diff) | |
download | scudo-4160bd72c25821504b7aff9d1ed2389491a54f5b.tar.gz |
[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>
-rw-r--r-- | standalone/wrappers_c.cpp | 2 | ||||
-rw-r--r-- | standalone/wrappers_c.h | 5 | ||||
-rw-r--r-- | standalone/wrappers_cpp.cpp | 4 |
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 {}; |