|
|
@ -1397,11 +1397,10 @@ func (h *Head) chunksRange(mint, maxt int64, is *isolationState) (*headChunkRead
|
|
|
|
mint = hmin
|
|
|
|
mint = hmin
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return &headChunkReader{
|
|
|
|
return &headChunkReader{
|
|
|
|
head: h,
|
|
|
|
head: h,
|
|
|
|
mint: mint,
|
|
|
|
mint: mint,
|
|
|
|
maxt: maxt,
|
|
|
|
maxt: maxt,
|
|
|
|
isoState: is,
|
|
|
|
isoState: is,
|
|
|
|
memChunkPool: &h.memChunkPool,
|
|
|
|
|
|
|
|
}, nil
|
|
|
|
}, nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1456,10 +1455,9 @@ func (h *Head) Close() error {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type headChunkReader struct {
|
|
|
|
type headChunkReader struct {
|
|
|
|
head *Head
|
|
|
|
head *Head
|
|
|
|
mint, maxt int64
|
|
|
|
mint, maxt int64
|
|
|
|
isoState *isolationState
|
|
|
|
isoState *isolationState
|
|
|
|
memChunkPool *sync.Pool
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (h *headChunkReader) Close() error {
|
|
|
|
func (h *headChunkReader) Close() error {
|
|
|
@ -1503,7 +1501,7 @@ func (h *headChunkReader) Chunk(ref uint64) (chunkenc.Chunk, error) {
|
|
|
|
if garbageCollect {
|
|
|
|
if garbageCollect {
|
|
|
|
// Set this to nil so that Go GC can collect it after it has been used.
|
|
|
|
// Set this to nil so that Go GC can collect it after it has been used.
|
|
|
|
c.chunk = nil
|
|
|
|
c.chunk = nil
|
|
|
|
h.memChunkPool.Put(c)
|
|
|
|
s.memChunkPool.Put(c)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}()
|
|
|
|
}()
|
|
|
|
|
|
|
|
|
|
|
|