buffer

package
v0.0.0-...-f8bfe20 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2025 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package buffer provides a pool of []byte.

Index

Constants

View Source
const (
	// MaxSegmentSize is the largest possible UDP datagram size.
	MaxSegmentSize = (1 << 16) - 1

	// RelayBufferSize is the default buffer size for TCP relays.
	// io.Copy default buffer size is 32 KiB, but the maximum packet
	// size of vmess/shadowsocks is about 16 KiB, so define a buffer
	// of 20 KiB to reduce the memory of each TCP relay.
	RelayBufferSize = 20 << 10
)

Variables

This section is empty.

Functions

func Get

func Get(size int) []byte

Get gets a []byte from default allocator with most appropriate cap.

func Put

func Put(buf []byte) error

Put returns a []byte to default allocator for future use.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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