Help us shape the future of Go! Take the 2026 Go Developer Survey

iobufpool

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(size int) *[]byte

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

func Put

func Put(buf *[]byte)

Put returns buf to the pool.

Types

This section is empty.

Jump to

Keyboard shortcuts

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