()
| 109 | var pullerBatchPool sync.Pool |
| 110 | |
| 111 | func newPullerBatch() *pullerBatch { |
| 112 | b, ok := pullerBatchPool.Get().(*pullerBatch) |
| 113 | if !ok { |
| 114 | b = &pullerBatch{ |
| 115 | buf: make([]byte, PullerBatchBytes), |
| 116 | vals: make([]super.Value, PullerBatchValues), |
| 117 | } |
| 118 | } |
| 119 | b.buf = b.buf[:0] |
| 120 | b.refs.Store(1) |
| 121 | b.vals = b.vals[:0] |
| 122 | return b |
| 123 | } |
| 124 | |
| 125 | // appendVal appends a copy of val to b. appendVal returns true if b is full |
| 126 | // (i.e., b.buf is full, b.buf had insufficient space for val.Bytes, or b.val is |