1 #ifndef TSAN_INTERCEPTORS_H
2 #define TSAN_INTERCEPTORS_H
4 #include "sanitizer_common/sanitizer_stacktrace.h"
9 class ScopedInterceptor {
11 ScopedInterceptor(ThreadState *thr, const char *fname, uptr pc);
14 ThreadState *const thr_;
21 #define SCOPED_INTERCEPTOR_RAW(func, ...) \
22 ThreadState *thr = cur_thread(); \
23 const uptr caller_pc = GET_CALLER_PC(); \
24 ScopedInterceptor si(thr, #func, caller_pc); \
25 const uptr pc = StackTrace::GetCurrentPc(); \
30 #define __libc_free __free
31 #define __libc_malloc __malloc
34 extern "C" void __libc_free(void *ptr);
35 extern "C" void *__libc_malloc(uptr size);
37 #endif // TSAN_INTERCEPTORS_H