[TTC-8][Sanitizers] 32 bit allocator respects allocator_may_return_null flag 36/149936/2
authorAlex Shlyapnikov <alekseys@google.com>
Wed, 13 Sep 2017 12:57:12 +0000 (15:57 +0300)
committerDongkyun Son <dongkyun.s@samsung.com>
Fri, 20 Oct 2017 08:24:38 +0000 (08:24 +0000)
commitd053aec2b788f18e016369baaaf3a73c3c6ff7cb
tree24ab4f75d759e192a339de6c91e0b145033614b6
parent47e16e738a6ef562ee456b4051e314242a5edbae
[TTC-8][Sanitizers] 32 bit allocator respects allocator_may_return_null flag

Summary:
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 D34243).

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

Reviewers: eugenis

Subscribers: kubamracek, llvm-commits

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

Change-Id: I2853a00cff5202189c5d4b15b1934c63d5206708
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@305972 91177308-0d34-0410-b5e6-96231b3b80d8
libsanitizer/sanitizer_common/sanitizer_allocator_local_cache.h
libsanitizer/sanitizer_common/sanitizer_allocator_primary32.h
libsanitizer/sanitizer_common/sanitizer_common.h
libsanitizer/sanitizer_common/sanitizer_posix.cc
libsanitizer/sanitizer_common/sanitizer_win.cc