[PATCH] D42557: [scudo] Add default implementations for weak functions
Kostya Kortchinsky via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 30 10:01:31 PST 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rCRT323795: [scudo] Add default implementations for weak functions (authored by cryptoad, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D42557?vs=131510&id=131995#toc
Repository:
rCRT Compiler Runtime
https://reviews.llvm.org/D42557
Files:
lib/scudo/scudo_allocator.cpp
lib/scudo/scudo_flags.cpp
lib/scudo/scudo_interface_internal.h
Index: lib/scudo/scudo_flags.cpp
===================================================================
--- lib/scudo/scudo_flags.cpp
+++ lib/scudo/scudo_flags.cpp
@@ -12,13 +12,12 @@
//===----------------------------------------------------------------------===//
#include "scudo_flags.h"
+#include "scudo_interface_internal.h"
#include "scudo_utils.h"
#include "sanitizer_common/sanitizer_flags.h"
#include "sanitizer_common/sanitizer_flag_parser.h"
-SANITIZER_INTERFACE_WEAK_DEF(const char*, __scudo_default_options, void);
-
namespace __scudo {
static Flags ScudoFlags; // Use via getFlags().
@@ -119,3 +118,9 @@
}
} // namespace __scudo
+
+#if !SANITIZER_SUPPORTS_WEAK_HOOKS
+SANITIZER_INTERFACE_WEAK_DEF(const char*, __scudo_default_options, void) {
+ return "";
+}
+#endif
Index: lib/scudo/scudo_allocator.cpp
===================================================================
--- lib/scudo/scudo_allocator.cpp
+++ lib/scudo/scudo_allocator.cpp
@@ -736,6 +736,18 @@
return Instance.getUsableSize(Ptr);
}
+#if !SANITIZER_SUPPORTS_WEAK_HOOKS
+SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_malloc_hook,
+ void *Ptr, uptr Size) {
+ (void)Ptr;
+ (void)Size;
+}
+
+SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_free_hook, void *Ptr) {
+ (void)Ptr;
+}
+#endif
+
// Interface functions
void __scudo_set_rss_limit(uptr LimitMb, s32 HardLimit) {
Index: lib/scudo/scudo_interface_internal.h
===================================================================
--- lib/scudo/scudo_interface_internal.h
+++ lib/scudo/scudo_interface_internal.h
@@ -20,6 +20,9 @@
using __sanitizer::s32;
extern "C" {
+SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
+const char* __scudo_default_options();
+
SANITIZER_INTERFACE_ATTRIBUTE
void __scudo_set_rss_limit(uptr LimitMb, s32 HardLimit);
} // extern "C"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42557.131995.patch
Type: text/x-patch
Size: 1864 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180130/453d5b93/attachment.bin>
More information about the llvm-commits
mailing list