[PATCH] D34433: [Sanitizers] 32 bit allocator respects allocator_may_return_null flag

Aleksey Shlyapnikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 20 17:40:01 PDT 2017


alekseyshl created this revision.
Herald added a subscriber: kubamracek.

Make SizeClassAllocator32 return nullptr when it encounters OOM, which
allows the entire sanitizer's allocator to follow allocator_may_return_null=1
policy, even for small allocations (LargeMmapAllocator is already fixed
by https://reviews.llvm.org/D34243).

Will add a test for OOM in primary allocator later, when
SizeClassAllocator64 can gracefully handle OOM too.


https://reviews.llvm.org/D34433

Files:
  lib/sanitizer_common/sanitizer_allocator_local_cache.h
  lib/sanitizer_common/sanitizer_allocator_primary32.h
  lib/sanitizer_common/sanitizer_common.h
  lib/sanitizer_common/sanitizer_posix.cc
  lib/sanitizer_common/sanitizer_win.cc
  lib/sanitizer_common/tests/sanitizer_common_test.cc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34433.103302.patch
Type: text/x-patch
Size: 9324 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170621/45ee6f3e/attachment.bin>


More information about the llvm-commits mailing list