Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BitmapPool ¶
type BitmapPool struct {
// contains filtered or unexported fields
}
BitmapPool manages a pool of *roaring.Bitmap objects to reduce GC pressure.
func (*BitmapPool) Get ¶
func (p *BitmapPool) Get() *roaring.Bitmap
Get retrieves an empty bitmap from the pool. The clear is not redundant with the one in Put: it is what makes "every Get returns an empty bitmap" hold for the pool regardless of how an object entered it, so a caller that recycles a bitmap it does not exclusively own can never leak its contents to the next owner. roaring's Clear only resets the container index, so it costs the same whether or not there is anything to drop.
func (*BitmapPool) Put ¶
func (p *BitmapPool) Put(bm *roaring.Bitmap)
Put returns a bitmap to the pool after clearing it.