diff options
author | Vitaly Buka <vitalybuka@google.com> | 2016-09-29 23:00:54 +0000 |
---|---|---|
committer | Vitaly Buka <vitalybuka@google.com> | 2016-09-29 23:00:54 +0000 |
commit | 4920473f3ce94b339e980fd92abfaa9271153b2d (patch) | |
tree | 669b15e42c6b8d3f2d5c0f6d75be96e987d9afb7 /lib/sanitizer_common/sanitizer_allocator.h | |
parent | 7473e4ca511a675be70c8e3ab90046de4a3d2ef2 (diff) | |
download | compiler-rt-4920473f3ce94b339e980fd92abfaa9271153b2d.tar.gz |
Don't use internal symbolizer if we are in process of reporting Out-of-Memory.
Reviewed by eugenis offline, as reviews.llvm.org is down.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@282805 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_allocator.h')
-rw-r--r-- | lib/sanitizer_common/sanitizer_allocator.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/sanitizer_common/sanitizer_allocator.h b/lib/sanitizer_common/sanitizer_allocator.h index da7435051..9a37a2f21 100644 --- a/lib/sanitizer_common/sanitizer_allocator.h +++ b/lib/sanitizer_common/sanitizer_allocator.h @@ -24,8 +24,13 @@ namespace __sanitizer { +// Returns true if ReportAllocatorCannotReturnNull(true) was called. +// Can be use to avoid memory hungry operations. +bool IsReportingOOM(); + // Prints error message and kills the program. -void NORETURN ReportAllocatorCannotReturnNull(); +void NORETURN ReportAllocatorCannotReturnNull(bool out_of_memory); + // Allocators call these callbacks on mmap/munmap. struct NoOpMapUnmapCallback { void OnMap(uptr p, uptr size) const { } |