diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2019-08-22 19:26:11 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2019-08-22 19:26:11 +0000 |
commit | 14a0b2859e9d76204ca897de961b36344ce1e775 (patch) | |
tree | 08901f9a2645ad5ec5813f4b15bdc92620e1f7e4 /contrib/compiler-rt/lib/scudo/standalone/report.h | |
parent | 580d4aa65a2dadf52a0abc9451ab25918cb25125 (diff) | |
parent | 8f3cadc28cb2bb9e8f9d69eeaaea1f57f2f7b2ab (diff) | |
download | src-14a0b2859e9d76204ca897de961b36344ce1e775.tar.gz src-14a0b2859e9d76204ca897de961b36344ce1e775.zip |
Merge compiler-rt trunk r366426, resolve conflicts, and add
FREEBSD-Xlist.
Notes
Notes:
svn path=/projects/clang900-import/; revision=351401
Diffstat (limited to 'contrib/compiler-rt/lib/scudo/standalone/report.h')
-rw-r--r-- | contrib/compiler-rt/lib/scudo/standalone/report.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/contrib/compiler-rt/lib/scudo/standalone/report.h b/contrib/compiler-rt/lib/scudo/standalone/report.h new file mode 100644 index 000000000000..14e4e799b736 --- /dev/null +++ b/contrib/compiler-rt/lib/scudo/standalone/report.h @@ -0,0 +1,57 @@ +//===-- report.h ------------------------------------------------*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef SCUDO_REPORT_H_ +#define SCUDO_REPORT_H_ + +#include "internal_defs.h" + +namespace scudo { + +// Reports are *fatal* unless stated otherwise. + +// Generic error. +void NORETURN reportError(const char *Message); + +// Flags related errors. +void NORETURN reportInvalidFlag(const char *FlagType, const char *Value); + +// Chunk header related errors. +void NORETURN reportHeaderCorruption(void *Ptr); +void NORETURN reportHeaderRace(void *Ptr); + +// Sanity checks related error. +void NORETURN reportSanityCheckError(const char *Field); + +// Combined allocator errors. +void NORETURN reportAlignmentTooBig(uptr Alignment, uptr MaxAlignment); +void NORETURN reportAllocationSizeTooBig(uptr UserSize, uptr TotalSize, + uptr MaxSize); +void NORETURN reportOutOfMemory(uptr RequestedSize); +enum class AllocatorAction : u8 { + Recycling, + Deallocating, + Reallocating, + Sizing, +}; +void NORETURN reportInvalidChunkState(AllocatorAction Action, void *Ptr); +void NORETURN reportMisalignedPointer(AllocatorAction Action, void *Ptr); +void NORETURN reportDeallocTypeMismatch(AllocatorAction Action, void *Ptr, + u8 TypeA, u8 TypeB); +void NORETURN reportDeleteSizeMismatch(void *Ptr, uptr Size, uptr ExpectedSize); + +// C wrappers errors. +void NORETURN reportAlignmentNotPowerOfTwo(uptr Alignment); +void NORETURN reportInvalidPosixMemalignAlignment(uptr Alignment); +void NORETURN reportCallocOverflow(uptr Count, uptr Size); +void NORETURN reportPvallocOverflow(uptr Size); +void NORETURN reportInvalidAlignedAllocAlignment(uptr Size, uptr Alignment); + +} // namespace scudo + +#endif // SCUDO_REPORT_H_ |