MCPcopy Create free account
hub / github.com/google/pprof / address

Method address

internal/report/synth.go:25–39  ·  view source on GitHub ↗

address returns the synthetic address for loc, creating one if needed.

(loc *profile.Location)

Source from the content-addressed store, hash-verified

23
24// address returns the synthetic address for loc, creating one if needed.
25func (s *synthCode) address(loc *profile.Location) uint64 {
26 if loc.Address != 0 {
27 panic("can only synthesize addresses for locations without an address")
28 }
29 if addr, ok := s.addr[loc]; ok {
30 return addr
31 }
32 if s.addr == nil {
33 s.addr = map[*profile.Location]uint64{}
34 }
35 addr := s.next
36 s.next++
37 s.addr[loc] = addr
38 return addr
39}

Callers 3

TestSynthAddressesFunction · 0.80
TestSynthAvoidsMappingFunction · 0.80
newSourcePrinterFunction · 0.80

Calls

no outgoing calls

Tested by 2

TestSynthAddressesFunction · 0.64
TestSynthAvoidsMappingFunction · 0.64