summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_allocator.h
diff options
context:
space:
mode:
authorAlex Shlyapnikov <alekseys@google.com>2018-03-28 18:22:40 +0000
committerAlex Shlyapnikov <alekseys@google.com>2018-03-28 18:22:40 +0000
commit85f6bace7a20b03d7a754d83a1b655b504eee0e3 (patch)
treeec96f5db4dbeeb76722f17629975eb875e671de5 /lib/sanitizer_common/sanitizer_allocator.h
parentd2575a962bced93ad1d1bc9c6551b9f54ccd71ef (diff)
downloadcompiler-rt-85f6bace7a20b03d7a754d83a1b655b504eee0e3.tar.gz
[ASan] Report proper ASan error on allocator failures instead of CHECK(0)-ing
Summary: Currently many allocator specific errors (OOM, for example) are reported as a text message and CHECK(0) termination, not stack, no details, not too helpful nor informative. To improve the situation, ASan detailed errors were defined and reported under the appropriate conditions. Issue: https://github.com/google/sanitizers/issues/887 Reviewers: eugenis Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D44404 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@328722 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_allocator.h')
-rw-r--r--lib/sanitizer_common/sanitizer_allocator.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/sanitizer_common/sanitizer_allocator.h b/lib/sanitizer_common/sanitizer_allocator.h
index 38368361d..8c6bb3968 100644
--- a/lib/sanitizer_common/sanitizer_allocator.h
+++ b/lib/sanitizer_common/sanitizer_allocator.h
@@ -43,9 +43,12 @@ struct DieOnFailure {
static void NORETURN *OnOOM();
};
+void PrintHintAllocatorCannotReturnNull(const char *options_name);
+
// Returns true if allocator detected OOM condition. Can be used to avoid memory
// hungry operations. Set when AllocatorReturnNullOrDieOnOOM() is called.
bool IsAllocatorOutOfMemory();
+void SetAllocatorOutOfMemory();
// Allocators call these callbacks on mmap/munmap.
struct NoOpMapUnmapCallback {