Skip to content

Commit 84da740

Browse files
committed
add linkname to runtime funcs, fix package docs
1 parent d533680 commit 84da740

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

src/internal/msan/doc.go

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
// Copyright 2023 The Go Authors. All rights reserved.
1+
// Copyright 2024 The Go Authors. All rights reserved.
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
/*
6-
Package msan contains helper functions for manually instrumenting code
7-
for the memory sanitizer.
8-
9-
This package exports the private msan routines in runtime unconditionally
10-
but without the "msan" build tag they are no-ops.
11-
*/
5+
// Package msan contains helper functions for manually instrumenting code
6+
// for the memory sanitizer.
7+
// This package exports the private msan routines in runtime unconditionally
8+
// but without the "msan" build tag they are no-ops.
129
package msan

src/internal/msan/msan.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2023 The Go Authors. All rights reserved.
1+
// Copyright 2024 The Go Authors. All rights reserved.
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

src/runtime/msan.go

+5
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const msanenabled = true
2929
// anyhow for values on the stack. Just ignore msanread when running
3030
// on the system stack. The other msan functions are fine.
3131
//
32+
//go:linkname msanread
3233
//go:nosplit
3334
func msanread(addr unsafe.Pointer, sz uintptr) {
3435
gp := getg()
@@ -41,15 +42,19 @@ func msanread(addr unsafe.Pointer, sz uintptr) {
4142
//go:noescape
4243
func domsanread(addr unsafe.Pointer, sz uintptr)
4344

45+
//go:linkname msanwrite
4446
//go:noescape
4547
func msanwrite(addr unsafe.Pointer, sz uintptr)
4648

49+
//go:linkname msanmalloc
4750
//go:noescape
4851
func msanmalloc(addr unsafe.Pointer, sz uintptr)
4952

53+
//go:linkname msanfree
5054
//go:noescape
5155
func msanfree(addr unsafe.Pointer, sz uintptr)
5256

57+
//go:linkname msanmove
5358
//go:noescape
5459
func msanmove(dst, src unsafe.Pointer, sz uintptr)
5560

0 commit comments

Comments
 (0)