Source file
src/runtime/covercounter.go
1
2
3
4
5 package runtime
6
7 import (
8 "internal/coverage/rtcov"
9 "unsafe"
10 )
11
12
13 func coverage_getCovCounterList() []rtcov.CovCounterBlob {
14 res := []rtcov.CovCounterBlob{}
15 u32sz := unsafe.Sizeof(uint32(0))
16 for datap := &firstmoduledata; datap != nil; datap = datap.next {
17 if datap.covctrs == datap.ecovctrs {
18 continue
19 }
20 res = append(res, rtcov.CovCounterBlob{
21 Counters: (*uint32)(unsafe.Pointer(datap.covctrs)),
22 Len: uint64((datap.ecovctrs - datap.covctrs) / u32sz),
23 })
24 }
25 return res
26 }
27
View as plain text