[PATCH] D121848: [scudo] Provide allocator declaration

Dominic Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 29 17:40:03 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG6ba8c8abe982: [scudo] Provide allocator declaration (authored by ddcc).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121848/new/

https://reviews.llvm.org/D121848

Files:
  compiler-rt/lib/scudo/standalone/wrappers_c.cpp
  compiler-rt/lib/scudo/standalone/wrappers_c.h
  compiler-rt/lib/scudo/standalone/wrappers_cpp.cpp


Index: compiler-rt/lib/scudo/standalone/wrappers_cpp.cpp
===================================================================
--- compiler-rt/lib/scudo/standalone/wrappers_cpp.cpp
+++ compiler-rt/lib/scudo/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 {};
Index: compiler-rt/lib/scudo/standalone/wrappers_c.h
===================================================================
--- compiler-rt/lib/scudo/standalone/wrappers_c.h
+++ compiler-rt/lib/scudo/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_
Index: compiler-rt/lib/scudo/standalone/wrappers_c.cpp
===================================================================
--- compiler-rt/lib/scudo/standalone/wrappers_c.cpp
+++ compiler-rt/lib/scudo/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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121848.419024.patch
Type: text/x-patch
Size: 1622 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220330/99db372a/attachment.bin>


More information about the llvm-commits mailing list