Search and commands

↑ ↓ to select · Enter to open · Esc to close

Type to search packages.

iobufpool

v5.13.0
github.com/jackc/pgx/v5/internal/iobufpool

Documentation

pkg.go.dev ↗

Table of contents

↓ to select · Enter to jump· Shift+Enter for source

3 matches

Top ↑

Package iobufpool implements a global segregated-fit pool of buffers for IO.

It uses *[]byte instead of []byte to avoid the sync.Pool allocation with Put. Unfortunately, using a pointer to avoid an allocation is purposely not documented. https://github.com/golang/go/issues/16323

Functions

Get

func Get(size int) *[]byte

Get gets a []byte of len size with cap <= size*2.

Put

func Put(buf *[]byte)

Put returns buf to the pool.

Dependency graph