...
Run Format

Source file src/runtime/msan/msan.go

Documentation: runtime/msan

     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  // +build msan,linux
     6  // +build amd64 arm64
     7  
     8  package msan
     9  
    10  /*
    11  #cgo CFLAGS: -fsanitize=memory
    12  #cgo LDFLAGS: -fsanitize=memory
    13  
    14  #include <stdint.h>
    15  #include <sanitizer/msan_interface.h>
    16  
    17  void __msan_read_go(void *addr, uintptr_t sz) {
    18  	__msan_check_mem_is_initialized(addr, sz);
    19  }
    20  
    21  void __msan_write_go(void *addr, uintptr_t sz) {
    22  	__msan_unpoison(addr, sz);
    23  }
    24  
    25  void __msan_malloc_go(void *addr, uintptr_t sz) {
    26  	__msan_unpoison(addr, sz);
    27  }
    28  
    29  void __msan_free_go(void *addr, uintptr_t sz) {
    30  	__msan_poison(addr, sz);
    31  }
    32  */
    33  import "C"
    34  

View as plain text