diff options
Diffstat (limited to 'compiler-rt/lib/sanitizer_common/sanitizer_allocator.h')
-rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_allocator.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_allocator.h b/compiler-rt/lib/sanitizer_common/sanitizer_allocator.h index da74350516a..9a37a2f2145 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_allocator.h +++ b/compiler-rt/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 { } |