MCPcopy Create free account
hub / github.com/prometheus/procfs / parseAddresses

Function parseAddresses

proc_maps.go:93–110  ·  view source on GitHub ↗

parseAddresses parses the start-end address.

(s string)

Source from the content-addressed store, hash-verified

91
92// parseAddresses parses the start-end address.
93func parseAddresses(s string) (uintptr, uintptr, error) {
94 idx := strings.Index(s, "-")
95 if idx == -1 {
96 return 0, 0, fmt.Errorf("%w: expected separator `-` in %s", ErrFileParse, s)
97 }
98
99 saddr, err := parseAddress(s[0:idx])
100 if err != nil {
101 return 0, 0, err
102 }
103
104 eaddr, err := parseAddress(s[idx+1:])
105 if err != nil {
106 return 0, 0, err
107 }
108
109 return saddr, eaddr, nil
110}
111
112// parsePermissions parses a token and returns any that are set.
113func parsePermissions(s string) (*ProcMapPermissions, error) {

Callers 2

BenchmarkParseAddressFunction · 0.85
parseProcMapFunction · 0.85

Calls 1

parseAddressFunction · 0.85

Tested by 1

BenchmarkParseAddressFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…