1 //===-- scudo_utils.h -------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 /// Header for scudo_utils.cpp.
12 //===----------------------------------------------------------------------===//
14 #ifndef SCUDO_UTILS_H_
15 #define SCUDO_UTILS_H_
17 #include "sanitizer_common/sanitizer_common.h"
23 template <class Dest, class Source>
24 INLINE Dest bit_cast(const Source& source) {
25 static_assert(sizeof(Dest) == sizeof(Source), "Sizes are not equal!");
27 memcpy(&dest, &source, sizeof(dest));
31 void NORETURN dieWithMessage(const char *Format, ...);
33 bool hasHardwareCRC32();
35 } // namespace __scudo
37 #endif // SCUDO_UTILS_H_