003 File Manager
Current Path:
/usr/src/contrib/llvm-project/compiler-rt/lib/lsan
usr
/
src
/
contrib
/
llvm-project
/
compiler-rt
/
lib
/
lsan
/
📁
..
📄
lsan.cpp
(3.22 KB)
📄
lsan.h
(1.8 KB)
📄
lsan_allocator.cpp
(10.62 KB)
📄
lsan_allocator.h
(4.36 KB)
📄
lsan_common.cpp
(32.24 KB)
📄
lsan_common.h
(9.36 KB)
📄
lsan_common_fuchsia.cpp
(6.16 KB)
📄
lsan_common_linux.cpp
(4.9 KB)
📄
lsan_common_mac.cpp
(6.91 KB)
📄
lsan_flags.inc
(2.08 KB)
📄
lsan_fuchsia.cpp
(4.32 KB)
📄
lsan_fuchsia.h
(1018 B)
📄
lsan_interceptors.cpp
(16.12 KB)
📄
lsan_linux.cpp
(1.08 KB)
📄
lsan_mac.cpp
(6.77 KB)
📄
lsan_malloc_mac.cpp
(2.16 KB)
📄
lsan_posix.cpp
(3.02 KB)
📄
lsan_posix.h
(1.29 KB)
📄
lsan_preinit.cpp
(833 B)
📄
lsan_thread.cpp
(3.21 KB)
📄
lsan_thread.h
(1.74 KB)
📄
weak_symbols.txt
(75 B)
Editing: lsan_malloc_mac.cpp
//===-- lsan_malloc_mac.cpp -----------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file is a part of LeakSanitizer (LSan), a memory leak detector. // // Mac-specific malloc interception. //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_platform.h" #if SANITIZER_MAC #include "lsan.h" #include "lsan_allocator.h" #include "lsan_thread.h" using namespace __lsan; #define COMMON_MALLOC_ZONE_NAME "lsan" #define COMMON_MALLOC_ENTER() ENSURE_LSAN_INITED #define COMMON_MALLOC_SANITIZER_INITIALIZED lsan_inited #define COMMON_MALLOC_FORCE_LOCK() #define COMMON_MALLOC_FORCE_UNLOCK() #define COMMON_MALLOC_MEMALIGN(alignment, size) \ GET_STACK_TRACE_MALLOC; \ void *p = lsan_memalign(alignment, size, stack) #define COMMON_MALLOC_MALLOC(size) \ GET_STACK_TRACE_MALLOC; \ void *p = lsan_malloc(size, stack) #define COMMON_MALLOC_REALLOC(ptr, size) \ GET_STACK_TRACE_MALLOC; \ void *p = lsan_realloc(ptr, size, stack) #define COMMON_MALLOC_CALLOC(count, size) \ GET_STACK_TRACE_MALLOC; \ void *p = lsan_calloc(count, size, stack) #define COMMON_MALLOC_POSIX_MEMALIGN(memptr, alignment, size) \ GET_STACK_TRACE_MALLOC; \ int res = lsan_posix_memalign(memptr, alignment, size, stack) #define COMMON_MALLOC_VALLOC(size) \ GET_STACK_TRACE_MALLOC; \ void *p = lsan_valloc(size, stack) #define COMMON_MALLOC_FREE(ptr) \ lsan_free(ptr) #define COMMON_MALLOC_SIZE(ptr) \ uptr size = lsan_mz_size(ptr) #define COMMON_MALLOC_FILL_STATS(zone, stats) #define COMMON_MALLOC_REPORT_UNKNOWN_REALLOC(ptr, zone_ptr, zone_name) \ (void)zone_name; \ Report("mz_realloc(%p) -- attempting to realloc unallocated memory.\n", ptr); #define COMMON_MALLOC_NAMESPACE __lsan #define COMMON_MALLOC_HAS_ZONE_ENUMERATOR 0 #define COMMON_MALLOC_HAS_EXTRA_INTROSPECTION_INIT 0 #include "sanitizer_common/sanitizer_malloc_mac.inc" #endif // SANITIZER_MAC
Upload File
Create Folder