1// Copyright 2015 The Go Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style 3// license that can be found in the LICENSE file. 4 5//go:build msan && ((linux && (amd64 || arm64 || loong64)) || (freebsd && amd64)) 6 7package msan 8 9/* 10#cgo CFLAGS: -fsanitize=memory 11#cgo LDFLAGS: -fsanitize=memory 12 13#include <stdint.h> 14#include <sanitizer/msan_interface.h> 15 16void __msan_read_go(void *addr, uintptr_t sz) { 17 __msan_check_mem_is_initialized(addr, sz); 18} 19 20void __msan_write_go(void *addr, uintptr_t sz) { 21 __msan_unpoison(addr, sz); 22} 23 24void __msan_malloc_go(void *addr, uintptr_t sz) { 25 __msan_unpoison(addr, sz); 26} 27 28void __msan_free_go(void *addr, uintptr_t sz) { 29 __msan_poison(addr, sz); 30} 31*/ 32import "C" 33