[PATCH] D34310: [Sanitizers] Move cached allocator_may_return_null flag to sanitizer_allocator

Aleksey Shlyapnikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 16 17:47:42 PDT 2017


alekseyshl created this revision.
Herald added subscribers: kubamracek, srhines.

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).


https://reviews.llvm.org/D34310

Files:
  lib/asan/asan_allocator.cc
  lib/lsan/lsan_allocator.cc
  lib/msan/msan_allocator.cc
  lib/sanitizer_common/sanitizer_allocator.cc
  lib/sanitizer_common/sanitizer_allocator.h
  lib/sanitizer_common/sanitizer_allocator_combined.h
  lib/sanitizer_common/sanitizer_allocator_secondary.h
  lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc
  lib/sanitizer_common/tests/sanitizer_allocator_test.cc
  lib/scudo/scudo_allocator.cpp
  lib/scudo/scudo_allocator_combined.h
  lib/scudo/scudo_allocator_secondary.h
  lib/tsan/rtl/tsan_mman.cc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34310.102916.patch
Type: text/x-patch
Size: 22991 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170617/ef9801b4/attachment.bin>


More information about the llvm-commits mailing list