Path: blob/main/contrib/llvm-project/compiler-rt/lib/scudo/standalone/report.h
35291 views
//===-- report.h ------------------------------------------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef SCUDO_REPORT_H_9#define SCUDO_REPORT_H_1011#include "internal_defs.h"1213namespace scudo {1415// Reports are *fatal* unless stated otherwise.1617// Generic error, adds newline to end of message.18void NORETURN reportError(const char *Message);1920// Generic error, but the message is not modified.21void NORETURN reportRawError(const char *Message);2223// Flags related errors.24void NORETURN reportInvalidFlag(const char *FlagType, const char *Value);2526// Chunk header related errors.27void NORETURN reportHeaderCorruption(void *Ptr);2829// Sanity checks related error.30void NORETURN reportSanityCheckError(const char *Field);3132// Combined allocator errors.33void NORETURN reportAlignmentTooBig(uptr Alignment, uptr MaxAlignment);34void NORETURN reportAllocationSizeTooBig(uptr UserSize, uptr TotalSize,35uptr MaxSize);36void NORETURN reportOutOfBatchClass();37void NORETURN reportOutOfMemory(uptr RequestedSize);38enum class AllocatorAction : u8 {39Recycling,40Deallocating,41Reallocating,42Sizing,43};44void NORETURN reportInvalidChunkState(AllocatorAction Action, void *Ptr);45void NORETURN reportMisalignedPointer(AllocatorAction Action, void *Ptr);46void NORETURN reportDeallocTypeMismatch(AllocatorAction Action, void *Ptr,47u8 TypeA, u8 TypeB);48void NORETURN reportDeleteSizeMismatch(void *Ptr, uptr Size, uptr ExpectedSize);4950// C wrappers errors.51void NORETURN reportAlignmentNotPowerOfTwo(uptr Alignment);52void NORETURN reportInvalidPosixMemalignAlignment(uptr Alignment);53void NORETURN reportCallocOverflow(uptr Count, uptr Size);54void NORETURN reportPvallocOverflow(uptr Size);55void NORETURN reportInvalidAlignedAllocAlignment(uptr Size, uptr Alignment);5657} // namespace scudo5859#endif // SCUDO_REPORT_H_606162