msan.h 750 Bytes
Newer Older
1
// Copyright 2013 the V8 project authors. All rights reserved.
2 3
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
4 5 6 7 8 9

// MemorySanitizer support.

#ifndef V8_MSAN_H_
#define V8_MSAN_H_

10
#include "src/globals.h"
11

12 13 14 15
#ifndef __has_feature
# define __has_feature(x) 0
#endif

16
#if __has_feature(memory_sanitizer) && !defined(MEMORY_SANITIZER)
17 18 19
# define MEMORY_SANITIZER
#endif

20
#if defined(MEMORY_SANITIZER)
21
# include <sanitizer/msan_interface.h>  // NOLINT
22 23 24 25 26 27 28 29

// Marks a memory range as uninitialized, as if it was allocated here.
# define MSAN_ALLOCATED_UNINITIALIZED_MEMORY(p, s) \
    __msan_allocated_memory((p), (s))
#else
# define MSAN_ALLOCATED_UNINITIALIZED_MEMORY(p, s)
#endif

30
#endif  // V8_MSAN_H_