pool

package
v1.11.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BufferPool

type BufferPool struct {
	// contains filtered or unexported fields
}

BufferPool provides a pool of byte slices for use as buffers.

func NewBufferPool

func NewBufferPool(count int) *BufferPool

NewBufferPool creates a pool of byte slices.

func (*BufferPool) Get

func (bp *BufferPool) Get(size int64) []byte

Get retrieves a byte buffer with the required capacity.

func (*BufferPool) Put

func (bp *BufferPool) Put(buf []byte)

Put returns a byte buffer to the pool for future reuse.

type ScannerPool

type ScannerPool struct {
	// contains filtered or unexported fields
}

ScannerPool provides a pool of yara-x scanners.

func NewScannerPool

func NewScannerPool(yrs *yarax.Rules, count int) *ScannerPool

NewScannerPool creates a pool containing the specified number of yara-x scanners.

func (*ScannerPool) Get

func (sp *ScannerPool) Get() *yarax.Scanner

Get retrieves a scanner from the scanner pool.

func (*ScannerPool) Put

func (sp *ScannerPool) Put(scanner *yarax.Scanner)

Put returns a scanner to the scanner pool.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL