Source file src/runtime/covermeta.go
1 // Copyright 2022 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 package runtime 6 7 import ( 8 "internal/coverage/rtcov" 9 "unsafe" 10 ) 11 12 // The compiler emits calls to runtime.addCovMeta 13 // but this code has moved to rtcov.AddMeta. 14 func addCovMeta(p unsafe.Pointer, dlen uint32, hash [16]byte, pkgpath string, pkgid int, cmode uint8, cgran uint8) uint32 { 15 id := rtcov.AddMeta(p, dlen, hash, pkgpath, pkgid, cmode, cgran) 16 if id == 0 { 17 throw("runtime.addCovMeta: coverage package map collision") 18 } 19 return id 20 } 21