Discover Packages
github.com/panjf2000/gnet/v2
pkg
pool
byteslice
package
Version:
v2.9.7
Opens a new window with list of versions in this module.
Published: Dec 27, 2025
License: Apache-2.0
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 16
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package byteslice implements a pool of byte slices consisting of sync.Pool's
that collect byte slices with different length sizes from 0 to 32 in powers of 2.
Get returns a byte slice with given length from the built-in pool.
Put returns the byte slice to the built-in pool.
Pool consists of 32 sync.Pool, representing byte slices of length from 0 to 32 in powers of 2.
Get retrieves a byte slice of the length requested by the caller from pool or allocates a new one.
Put returns the byte slice to the pool.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.