buffer

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

*

  • sync.Pool是一个可以存或取的临时对象集合; 可以安全被多个线程同时使用,保证线程安全;sync.Pool中保存的任何项都可能随时不做通知的释放掉,所以不适合用于像socket长连接或数据库连接池。
  • sync.Pool主要用途是增加临时对象的重用率,减少GC负担。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pool

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

func NewPool

func NewPool(s int) *Pool

func (*Pool) Get

func (p *Pool) Get() *bytes.Buffer

func (*Pool) Put

func (p *Pool) Put(buf *bytes.Buffer)

Jump to

Keyboard shortcuts

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