MCPcopy
hub / github.com/tinylib/msgp / NewEndlessReader

Function NewEndlessReader

msgp/circular.go:19–28  ·  view source on GitHub ↗

NewEndlessReader returns a new endless reader. Buffer b cannot be empty

(b []byte, tb timer)

Source from the content-addressed store, hash-verified

17// NewEndlessReader returns a new endless reader.
18// Buffer b cannot be empty
19func NewEndlessReader(b []byte, tb timer) *EndlessReader {
20 if len(b) == 0 {
21 panic("EndlessReader cannot be of zero length")
22 }
23 // Double until we reach 4K.
24 for len(b) < 4<<10 {
25 b = append(b, b...)
26 }
27 return &EndlessReader{tb: tb, data: b, offset: 0}
28}
29
30// Read implements io.Reader. In practice, it
31// always returns (len(p), nil), although it

Callers 15

BenchmarkFastDecodeFunction · 0.92
BenchmarkReadMapHeaderFunction · 0.85
BenchmarkReadArrayHeaderFunction · 0.85
BenchmarkReadNilFunction · 0.85
BenchmarkReadFloat64Function · 0.85
BenchmarkReadFloat32Function · 0.85
BenchmarkReadInt64Function · 0.85
BenchmarkReadUint64Function · 0.85
benchBytesFunction · 0.85
benchStringFunction · 0.85

Calls

no outgoing calls

Tested by 15

BenchmarkFastDecodeFunction · 0.74
BenchmarkReadMapHeaderFunction · 0.68
BenchmarkReadArrayHeaderFunction · 0.68
BenchmarkReadNilFunction · 0.68
BenchmarkReadFloat64Function · 0.68
BenchmarkReadFloat32Function · 0.68
BenchmarkReadInt64Function · 0.68
BenchmarkReadUint64Function · 0.68
benchBytesFunction · 0.68
benchStringFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…