summaryrefslogtreecommitdiff
path: root/lib/asan/asan_internal.h
diff options
context:
space:
mode:
authorAlexey Samsonov <vonosmas@gmail.com>2014-07-07 17:39:31 +0000
committerAlexey Samsonov <vonosmas@gmail.com>2014-07-07 17:39:31 +0000
commit2ef0c30d2101ca6521b7ecbdd17e4fbcca09a951 (patch)
tree362337877acfa4824664514a5a3b54216bc670c1 /lib/asan/asan_internal.h
parent58dd99ec88cc51a5a1adcd4eddff212576a9067c (diff)
Generalize sanitizer allocator public interface.
Introduce new public header <sanitizer/allocator_interface.h> and a set of functions __sanitizer_get_ownership(), __sanitizer_malloc_hook() etc. that will eventually replace their tool-specific equivalents (__asan_get_ownership(), __msan_get_ownership() etc.). Tool-specific functions are now deprecated and implemented as stubs redirecting to __sanitizer_ versions (which are implemented differently in each tool). Replace all uses of __xsan_ versions with __sanitizer_ versions in unit and lit tests. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@212469 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_internal.h')
-rw-r--r--lib/asan/asan_internal.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/asan/asan_internal.h b/lib/asan/asan_internal.h
index 9d7d1d9e9..0782789db 100644
--- a/lib/asan/asan_internal.h
+++ b/lib/asan/asan_internal.h
@@ -112,9 +112,11 @@ bool PlatformHasDifferentMemcpyAndMemmove();
// Add convenient macro for interface functions that may be represented as
// weak hooks.
#define ASAN_MALLOC_HOOK(ptr, size) \
- if (&__asan_malloc_hook) __asan_malloc_hook(ptr, size)
+ if (&__asan_malloc_hook) __asan_malloc_hook(ptr, size); \
+ if (&__sanitizer_malloc_hook) __sanitizer_malloc_hook(ptr, size)
#define ASAN_FREE_HOOK(ptr) \
- if (&__asan_free_hook) __asan_free_hook(ptr)
+ if (&__asan_free_hook) __asan_free_hook(ptr); \
+ if (&__sanitizer_free_hook) __sanitizer_free_hook(ptr)
#define ASAN_ON_ERROR() \
if (&__asan_on_error) __asan_on_error()