MCPcopy
hub / github.com/IBM/sarama / acquireCrc32Field

Function acquireCrc32Field

crc32_field.go:19–27  ·  view source on GitHub ↗
(polynomial crcPolynomial)

Source from the content-addressed store, hash-verified

17var crc32FieldPool = sync.Pool{}
18
19func acquireCrc32Field(polynomial crcPolynomial) *crc32Field {
20 val := crc32FieldPool.Get()
21 if val != nil {
22 c := val.(*crc32Field)
23 c.polynomial = polynomial
24 return c
25 }
26 return newCRC32Field(polynomial)
27}
28
29func releaseCrc32Field(c *crc32Field) {
30 crc32FieldPool.Put(c)

Callers 2

decodeMethod · 0.85
decodeMethod · 0.85

Calls 2

newCRC32FieldFunction · 0.85
GetMethod · 0.45

Tested by

no test coverage detected