diff options
author | Michail Kashkarov <m.kashkarov@partner.samsung.com> | 2017-11-15 20:50:30 +0300 |
---|---|---|
committer | Dongkyun Son <dongkyun.s@samsung.com> | 2017-12-27 10:26:07 +0900 |
commit | 4de2963ea2ecd22ab01f8849b830cbdcd75e2a69 (patch) | |
tree | 765d6f2598b3952736dcb1cd5e0c3ac8c294802d | |
parent | 20be925916db081c8a4daabecf9fdf78e3d367ab (diff) | |
download | linaro-gcc-sandbox/dkson95/lsan.tar.gz linaro-gcc-sandbox/dkson95/lsan.tar.bz2 linaro-gcc-sandbox/dkson95/lsan.zip |
[ASan] Add support for lsan background leak checking thread.sandbox/dkson95/lsan
Change-Id: I61dbebdecd0f608736e8a1649595868cc119a8e4
-rw-r--r-- | libsanitizer/asan/asan_rtl.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/libsanitizer/asan/asan_rtl.cc b/libsanitizer/asan/asan_rtl.cc index 8b28e6aa247..5bafb9a78cf 100644 --- a/libsanitizer/asan/asan_rtl.cc +++ b/libsanitizer/asan/asan_rtl.cc @@ -594,11 +594,14 @@ static void AsanInitInternal() { if (CAN_SANITIZE_LEAKS) { __lsan::InitCommonLsan(); - if (common_flags()->detect_leaks && common_flags()->leak_check_at_exit) { - if (flags()->halt_on_error) - Atexit(__lsan::DoLeakCheck); - else - Atexit(__lsan::DoRecoverableLeakCheckVoid); + if (common_flags()->detect_leaks) { + __lsan::MaybeStartBackgroudLeakCheckingThread(); + if (common_flags()->leak_check_at_exit) { + if (flags()->halt_on_error) + Atexit(__lsan::DoLeakCheck); + else + Atexit(__lsan::DoRecoverableLeakCheckVoid); + } } } |