Index: lib/sanitizer_common/sanitizer_allocator_internal.h =================================================================== --- lib/sanitizer_common/sanitizer_allocator_internal.h +++ lib/sanitizer_common/sanitizer_allocator_internal.h @@ -62,15 +62,6 @@ void InternalFree(void *p, InternalAllocatorCache *cache = nullptr); InternalAllocator *internal_allocator(); -enum InternalAllocEnum { - INTERNAL_ALLOC -}; - } // namespace __sanitizer -inline void *operator new(__sanitizer::operator_new_size_type size, - __sanitizer::InternalAllocEnum) { - return __sanitizer::InternalAlloc(size); -} - #endif // SANITIZER_ALLOCATOR_INTERNAL_H Index: lib/sanitizer_common/sanitizer_common_nolibc.cc =================================================================== --- lib/sanitizer_common/sanitizer_common_nolibc.cc +++ lib/sanitizer_common/sanitizer_common_nolibc.cc @@ -21,7 +21,6 @@ // bypassing libc. #if !SANITIZER_WINDOWS #if SANITIZER_LINUX -bool ShouldLogAfterPrintf() { return false; } void LogMessageOnPrintf(const char *str) {} #endif void WriteToSyslog(const char *buffer) {} Index: lib/sanitizer_common/sanitizer_flags.cc =================================================================== --- lib/sanitizer_common/sanitizer_flags.cc +++ lib/sanitizer_common/sanitizer_flags.cc @@ -22,14 +22,6 @@ CommonFlags common_flags_dont_use; -struct FlagDescription { - const char *name; - const char *description; - FlagDescription *next; -}; - -IntrusiveList flag_descriptions; - void CommonFlags::SetDefaults() { #define COMMON_FLAG(Type, Name, DefaultValue, Description) Name = DefaultValue; #include "sanitizer_flags.inc" Index: lib/sanitizer_common/sanitizer_libc.h =================================================================== --- lib/sanitizer_common/sanitizer_libc.h +++ lib/sanitizer_common/sanitizer_libc.h @@ -32,8 +32,6 @@ int internal_memcmp(const void* s1, const void* s2, uptr n); void *internal_memcpy(void *dest, const void *src, uptr n); void *internal_memmove(void *dest, const void *src, uptr n); -// Set [s, s + n) to 0. Both s and n should be 16-aligned. -void internal_bzero_aligned16(void *s, uptr n); // Should not be used in performance-critical places. void *internal_memset(void *s, int c, uptr n); char* internal_strchr(const char *s, int c); @@ -41,7 +39,6 @@ int internal_strcmp(const char *s1, const char *s2); uptr internal_strcspn(const char *s, const char *reject); char *internal_strdup(const char *s); -char *internal_strndup(const char *s, uptr n); uptr internal_strlen(const char *s); uptr internal_strlcat(char *dst, const char *src, uptr maxlen); char *internal_strncat(char *dst, const char *src, uptr n); @@ -50,8 +47,6 @@ char *internal_strncpy(char *dst, const char *src, uptr n); uptr internal_strnlen(const char *s, uptr maxlen); char *internal_strrchr(const char *s, int c); -// This is O(N^2), but we are not using it in hot places. -uptr internal_wcslen(const wchar_t *s); char *internal_strstr(const char *haystack, const char *needle); // Works only for base=10 and doesn't set errno. s64 internal_simple_strtoll(const char *nptr, char **endptr, int base); Index: lib/sanitizer_common/sanitizer_libc.cc =================================================================== --- lib/sanitizer_common/sanitizer_libc.cc +++ lib/sanitizer_common/sanitizer_libc.cc @@ -72,17 +72,6 @@ return dest; } -// Semi-fast bzero for 16-aligned data. Still far from peak performance. -void internal_bzero_aligned16(void *s, uptr n) { - struct ALIGNED(16) S16 { u64 a, b; }; - CHECK_EQ((reinterpret_cast(s) | n) & 15, 0); - for (S16 *p = reinterpret_cast(s), *end = p + n / 16; p < end; p++) { - p->a = p->b = 0; - // Make sure this does not become memset. - SanitizerBreakOptimization(nullptr); - } -} - void *internal_memset(void* s, int c, uptr n) { // The next line prevents Clang from making a call to memset() instead of the // loop below. @@ -112,14 +101,6 @@ return s2; } -char* internal_strndup(const char *s, uptr n) { - uptr len = internal_strnlen(s, n); - char *s2 = (char*)InternalAlloc(len + 1); - internal_memcpy(s2, s, len); - s2[len] = 0; - return s2; -} - int internal_strcmp(const char *s1, const char *s2) { while (true) { unsigned c1 = *s1; @@ -234,12 +215,6 @@ return nullptr; } -uptr internal_wcslen(const wchar_t *s) { - uptr i = 0; - while (s[i]) i++; - return i; -} - s64 internal_simple_strtoll(const char *nptr, char **endptr, int base) { CHECK_EQ(base, 10); while (IsSpace(*nptr)) nptr++;