[Sanitizers] Move cached allocator_may_return_null flag to sanitizer_allocator
authorAlex Shlyapnikov <alekseys@google.com>
Fri, 22 Jun 2018 12:33:11 +0000 (15:33 +0300)
committerSlava Barinov <v.barinov@samsung.com>
Thu, 24 Oct 2019 09:30:45 +0000 (12:30 +0300)
commit46c117c8264f2348307c13722d1fd1b2a7fc4638
tree02c1f4004fdbd77ae51f7bf97df8609bd67c98ee
parent2d349965b895ca1fcd0b3b0f0fb35e57d4c24984
[Sanitizers] Move cached allocator_may_return_null flag to sanitizer_allocator

Summary:
Move cached allocator_may_return_null flag to sanitizer_allocator.cc and
provide API to consolidate and unify the behavior of all specific allocators.

Make all sanitizers using CombinedAllocator to follow
AllocatorReturnNullOrDieOnOOM() rules to behave the same way when OOM
happens.

When OOM happens, turn allocator_out_of_memory flag on regardless of
allocator_may_return_null flag value (it used to not to be set when
allocator_may_return_null == true).

release_to_os_interval_ms and rss_limit_exceeded will likely be moved to
sanitizer_allocator.cc too (later).

Reviewers: eugenis

Subscribers: srhines, kubamracek, llvm-commits

Differential Revision: https://reviews.llvm.org/D34310

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@305858 91177308-0d34-0410-b5e6-96231b3b80d8

Change-Id: I29ae28a1f9c569d69666936111e307c3aecf9314
libsanitizer/asan/asan_allocator.cc
libsanitizer/lsan/lsan_allocator.cc
libsanitizer/sanitizer_common/sanitizer_allocator.cc
libsanitizer/sanitizer_common/sanitizer_allocator.h
libsanitizer/sanitizer_common/sanitizer_allocator_combined.h
libsanitizer/sanitizer_common/sanitizer_allocator_internal.h
libsanitizer/sanitizer_common/sanitizer_allocator_secondary.h
libsanitizer/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc
libsanitizer/tsan/tsan_mman.cc