bytespool

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2021 License: MIT Imports: 6 Imported by: 0

README

bytespool

A collection of pools for variable-sized objects: []byte, *bufio.Reader, *bufio.Writer and *bytes.Buffer.

High-level APIs

Once you import github.com/CAFxX/bytespool you have access to these high-level APIs:

  • GetBufferPool(size int) httputil.BufferPool
  • GetBufioReader(pr io.Reader, size int) *bufio.Reader and PutBufioReader(r *bufio.Reader) bool
  • GetBufioWriter(pw io.Writer, size int) *bufio.Writer and PutBufioWriter(w *bufio.Writer) bool
  • GetBytesBuffer(size int) *bytes.Buffer and PutBytesBuffer(b *bytes.Buffer) bool
  • GetBytesSlice(size int) []byte and PutBytesSlice(b []byte) bool
  • GetBytesSlicePtr(size int) *[]byte and PutBytesSlicePtr(b *[]byte) bool

In addition, the following utility APIs are available:

  • Append is a replacement for append that uses the backing pools to avoid allocations when appending to byte slices.

bytespool relies on code generation to allow to control the granularity of the backing pools.

The generated code contains specialized versions of all functions for each of the backing pools. These functions can be used to provide a small speed-up if you statically know the desired sizes at compile-time.

Note that it is allowed to pass to the PutXxx functions objects that have been obtained not from GetXxx or that have undergone resizing. If the PutXxx functions detect that the object can not be recycled they will return false without modifying the object.

Examples

Minimizing allocations in ReverseProxy

httputil.ReverseProxy can use an httputil.BufferPool to minimize allocations. You can provide one as follows:

rp := httputil.NewSingleHostReverseProxy(target)
rp.BufferPool = bytespool.GetBufferPool(32*1024)

Benchmarks

There is a small set of benchmarks you can run with make bench (you need to have benchstat on your PATH), from which you can validate that in steady state no allocations are performed even for []byte:

name                           time/op
GetBytesSlice-12               8.56ns ±14%
GetBytesSliceSemiStatic-12     8.26ns ±14%
GetBytesSliceStatic-12         8.19ns ±16%
GetBytesSlicePtr-12            5.18ns ±23%
GetBytesSlicePtrSemiStatic-12  4.74ns ±22%
GetBytesSlicePtrStatic-12      4.74ns ±22%
GetBytesBuffer-12              3.64ns ± 8%
GetBytesBufferSemiStatic-12    3.18ns ± 5%
GetBytesBufferStatic-12        3.12ns ± 5%
GetBufioReader-12              5.82ns ± 7%
GetBufioReaderSemiStatic-12    5.45ns ±10%
GetBufioReaderStatic-12        5.39ns ± 6%
GetBufioWriter-12              4.02ns ± 2%
GetBufioWriterSemiStatic-12    3.73ns ± 4%
GetBufioWriterStatic-12        3.56ns ± 3%

name                           alloc/op
GetBytesSlice-12                0.00B
GetBytesSliceSemiStatic-12      0.00B
GetBytesSliceStatic-12          0.00B
GetBytesSlicePtr-12             0.00B
GetBytesSlicePtrSemiStatic-12   0.00B
GetBytesSlicePtrStatic-12       0.00B
GetBytesBuffer-12               0.00B
GetBytesBufferSemiStatic-12     0.00B
GetBytesBufferStatic-12         0.00B
GetBufioReader-12               0.00B
GetBufioReaderSemiStatic-12     0.00B
GetBufioReaderStatic-12         0.00B
GetBufioWriter-12               0.00B
GetBufioWriterSemiStatic-12     0.00B
GetBufioWriterStatic-12         0.00B

name                           allocs/op
GetBytesSlice-12                 0.00
GetBytesSliceSemiStatic-12       0.00
GetBytesSliceStatic-12           0.00
GetBytesSlicePtr-12              0.00
GetBytesSlicePtrSemiStatic-12    0.00
GetBytesSlicePtrStatic-12        0.00
GetBytesBuffer-12                0.00
GetBytesBufferSemiStatic-12      0.00
GetBytesBufferStatic-12          0.00
GetBufioReader-12                0.00
GetBufioReaderSemiStatic-12      0.00
GetBufioReaderStatic-12          0.00
GetBufioWriter-12                0.00
GetBufioWriterSemiStatic-12      0.00
GetBufioWriterStatic-12          0.00

Developing

Most of the code is in gen/main.go. You can run make generate to generate bytespool.go.

TODO

  • Split low-level APIs in a separate package
  • Ensure that users of the low-level API are not forced to compile also the high-level APIs
  • Define BufferPool-like interfaces for all objects (e.g. BytesBufferPool)
  • Provide non-singleton pools

Documentation

Overview

Package bytespool implements a series of sync.Pools tailored to safely recycle byte slices and bytes.Buffers. It works by defining a number of buckets, each for slices or Buffers of a certain range of capacities, and directing the Put and Get requests to the appropriate bucket. This package is autogenerated to allow to customize the granularity of the buckets and the range of supported capacities. This version was generated with the following buckets: 256B 512B 1KB 2KB 4KB 8KB 16KB 32KB 64KB 128KB 256KB 512KB 1MB 2MB 4MB 8MB 16MB. It is advisable not to grow/extend the byte slices or bytes.Buffer returned by bytespool, as this incurs allocations. To avoid this, use bytespool to allocate a new object of the desired size, copy the data to the new object and then recycle the original object.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Append

func Append(buf []byte, v ...byte) []byte

Append appends the specified bytes to the buf byte slice. The buf byte slice passed to Append MUST NOT be used after Append is called: only the byte slice returned should be used.

func GetBufferPool

func GetBufferPool(size int) httputil.BufferPool

GetBufferPool returns a httputil.BufferPool that returns byte slices of capacity greater or equal than size, and of size size.

func GetBufioReader

func GetBufioReader(pr io.Reader, size int) *bufio.Reader

GetBufioReader returns a bufio.Reader of at least the specified size.

func GetBufioReader128K

func GetBufioReader128K(pr io.Reader) *bufio.Reader

GetBufioReader128K returns a bufio.Reader with an internal buffer size of at least 131072.

func GetBufioReader16K

func GetBufioReader16K(pr io.Reader) *bufio.Reader

GetBufioReader16K returns a bufio.Reader with an internal buffer size of at least 16384.

func GetBufioReader16M

func GetBufioReader16M(pr io.Reader) *bufio.Reader

GetBufioReader16M returns a bufio.Reader with an internal buffer size of at least 16777216.

func GetBufioReader1K

func GetBufioReader1K(pr io.Reader) *bufio.Reader

GetBufioReader1K returns a bufio.Reader with an internal buffer size of at least 1024.

func GetBufioReader1M

func GetBufioReader1M(pr io.Reader) *bufio.Reader

GetBufioReader1M returns a bufio.Reader with an internal buffer size of at least 1048576.

func GetBufioReader256

func GetBufioReader256(pr io.Reader) *bufio.Reader

GetBufioReader256 returns a bufio.Reader with an internal buffer size of at least 256.

func GetBufioReader256K

func GetBufioReader256K(pr io.Reader) *bufio.Reader

GetBufioReader256K returns a bufio.Reader with an internal buffer size of at least 262144.

func GetBufioReader2K

func GetBufioReader2K(pr io.Reader) *bufio.Reader

GetBufioReader2K returns a bufio.Reader with an internal buffer size of at least 2048.

func GetBufioReader2M

func GetBufioReader2M(pr io.Reader) *bufio.Reader

GetBufioReader2M returns a bufio.Reader with an internal buffer size of at least 2097152.

func GetBufioReader32K

func GetBufioReader32K(pr io.Reader) *bufio.Reader

GetBufioReader32K returns a bufio.Reader with an internal buffer size of at least 32768.

func GetBufioReader4K

func GetBufioReader4K(pr io.Reader) *bufio.Reader

GetBufioReader4K returns a bufio.Reader with an internal buffer size of at least 4096.

func GetBufioReader4M

func GetBufioReader4M(pr io.Reader) *bufio.Reader

GetBufioReader4M returns a bufio.Reader with an internal buffer size of at least 4194304.

func GetBufioReader512

func GetBufioReader512(pr io.Reader) *bufio.Reader

GetBufioReader512 returns a bufio.Reader with an internal buffer size of at least 512.

func GetBufioReader512K

func GetBufioReader512K(pr io.Reader) *bufio.Reader

GetBufioReader512K returns a bufio.Reader with an internal buffer size of at least 524288.

func GetBufioReader64K

func GetBufioReader64K(pr io.Reader) *bufio.Reader

GetBufioReader64K returns a bufio.Reader with an internal buffer size of at least 65536.

func GetBufioReader8K

func GetBufioReader8K(pr io.Reader) *bufio.Reader

GetBufioReader8K returns a bufio.Reader with an internal buffer size of at least 8192.

func GetBufioReader8M

func GetBufioReader8M(pr io.Reader) *bufio.Reader

GetBufioReader8M returns a bufio.Reader with an internal buffer size of at least 8388608.

func GetBufioWriter

func GetBufioWriter(pw io.Writer, size int) *bufio.Writer

GetBufioWriter returns a bufio.Writer of at least the specified size.

func GetBufioWriter128K

func GetBufioWriter128K(pw io.Writer) *bufio.Writer

GetBufioWriter128K returns a bufio.Writer with an internal buffer size of at least 131072.

func GetBufioWriter16K

func GetBufioWriter16K(pw io.Writer) *bufio.Writer

GetBufioWriter16K returns a bufio.Writer with an internal buffer size of at least 16384.

func GetBufioWriter16M

func GetBufioWriter16M(pw io.Writer) *bufio.Writer

GetBufioWriter16M returns a bufio.Writer with an internal buffer size of at least 16777216.

func GetBufioWriter1K

func GetBufioWriter1K(pw io.Writer) *bufio.Writer

GetBufioWriter1K returns a bufio.Writer with an internal buffer size of at least 1024.

func GetBufioWriter1M

func GetBufioWriter1M(pw io.Writer) *bufio.Writer

GetBufioWriter1M returns a bufio.Writer with an internal buffer size of at least 1048576.

func GetBufioWriter256

func GetBufioWriter256(pw io.Writer) *bufio.Writer

GetBufioWriter256 returns a bufio.Writer with an internal buffer size of at least 256.

func GetBufioWriter256K

func GetBufioWriter256K(pw io.Writer) *bufio.Writer

GetBufioWriter256K returns a bufio.Writer with an internal buffer size of at least 262144.

func GetBufioWriter2K

func GetBufioWriter2K(pw io.Writer) *bufio.Writer

GetBufioWriter2K returns a bufio.Writer with an internal buffer size of at least 2048.

func GetBufioWriter2M

func GetBufioWriter2M(pw io.Writer) *bufio.Writer

GetBufioWriter2M returns a bufio.Writer with an internal buffer size of at least 2097152.

func GetBufioWriter32K

func GetBufioWriter32K(pw io.Writer) *bufio.Writer

GetBufioWriter32K returns a bufio.Writer with an internal buffer size of at least 32768.

func GetBufioWriter4K

func GetBufioWriter4K(pw io.Writer) *bufio.Writer

GetBufioWriter4K returns a bufio.Writer with an internal buffer size of at least 4096.

func GetBufioWriter4M

func GetBufioWriter4M(pw io.Writer) *bufio.Writer

GetBufioWriter4M returns a bufio.Writer with an internal buffer size of at least 4194304.

func GetBufioWriter512

func GetBufioWriter512(pw io.Writer) *bufio.Writer

GetBufioWriter512 returns a bufio.Writer with an internal buffer size of at least 512.

func GetBufioWriter512K

func GetBufioWriter512K(pw io.Writer) *bufio.Writer

GetBufioWriter512K returns a bufio.Writer with an internal buffer size of at least 524288.

func GetBufioWriter64K

func GetBufioWriter64K(pw io.Writer) *bufio.Writer

GetBufioWriter64K returns a bufio.Writer with an internal buffer size of at least 65536.

func GetBufioWriter8K

func GetBufioWriter8K(pw io.Writer) *bufio.Writer

GetBufioWriter8K returns a bufio.Writer with an internal buffer size of at least 8192.

func GetBufioWriter8M

func GetBufioWriter8M(pw io.Writer) *bufio.Writer

GetBufioWriter8M returns a bufio.Writer with an internal buffer size of at least 8388608.

func GetBytesBuffer

func GetBytesBuffer(size int) *bytes.Buffer

GetBytesBuffer returns a bytes.Buffer with at least size bytes of capacity. If your code uses buffers of static size, it is more performant to call one of the GetBytesBufferXxx functions instead. Calling GetBytesBuffer with a negative size panics.

func GetBytesBuffer128K

func GetBytesBuffer128K() *bytes.Buffer

GetBytesBuffer128K gets a bytes.Buffer with a capacity of at least 128K bytes.

func GetBytesBuffer16K

func GetBytesBuffer16K() *bytes.Buffer

GetBytesBuffer16K gets a bytes.Buffer with a capacity of at least 16K bytes.

func GetBytesBuffer16M

func GetBytesBuffer16M() *bytes.Buffer

GetBytesBuffer16M gets a bytes.Buffer with a capacity of at least 16M bytes.

func GetBytesBuffer1K

func GetBytesBuffer1K() *bytes.Buffer

GetBytesBuffer1K gets a bytes.Buffer with a capacity of at least 1K bytes.

func GetBytesBuffer1M

func GetBytesBuffer1M() *bytes.Buffer

GetBytesBuffer1M gets a bytes.Buffer with a capacity of at least 1M bytes.

func GetBytesBuffer256

func GetBytesBuffer256() *bytes.Buffer

GetBytesBuffer256 gets a bytes.Buffer with a capacity of at least 256 bytes.

func GetBytesBuffer256K

func GetBytesBuffer256K() *bytes.Buffer

GetBytesBuffer256K gets a bytes.Buffer with a capacity of at least 256K bytes.

func GetBytesBuffer2K

func GetBytesBuffer2K() *bytes.Buffer

GetBytesBuffer2K gets a bytes.Buffer with a capacity of at least 2K bytes.

func GetBytesBuffer2M

func GetBytesBuffer2M() *bytes.Buffer

GetBytesBuffer2M gets a bytes.Buffer with a capacity of at least 2M bytes.

func GetBytesBuffer32K

func GetBytesBuffer32K() *bytes.Buffer

GetBytesBuffer32K gets a bytes.Buffer with a capacity of at least 32K bytes.

func GetBytesBuffer4K

func GetBytesBuffer4K() *bytes.Buffer

GetBytesBuffer4K gets a bytes.Buffer with a capacity of at least 4K bytes.

func GetBytesBuffer4M

func GetBytesBuffer4M() *bytes.Buffer

GetBytesBuffer4M gets a bytes.Buffer with a capacity of at least 4M bytes.

func GetBytesBuffer512

func GetBytesBuffer512() *bytes.Buffer

GetBytesBuffer512 gets a bytes.Buffer with a capacity of at least 512 bytes.

func GetBytesBuffer512K

func GetBytesBuffer512K() *bytes.Buffer

GetBytesBuffer512K gets a bytes.Buffer with a capacity of at least 512K bytes.

func GetBytesBuffer64K

func GetBytesBuffer64K() *bytes.Buffer

GetBytesBuffer64K gets a bytes.Buffer with a capacity of at least 64K bytes.

func GetBytesBuffer8K

func GetBytesBuffer8K() *bytes.Buffer

GetBytesBuffer8K gets a bytes.Buffer with a capacity of at least 8K bytes.

func GetBytesBuffer8M

func GetBytesBuffer8M() *bytes.Buffer

GetBytesBuffer8M gets a bytes.Buffer with a capacity of at least 8M bytes.

func GetBytesSlice

func GetBytesSlice(size int) []byte

GetBytesSlice returns a byte slice with at least size bytes of capacity and length size. If your code uses buffers of static size, it is more performant to call one of the GetBytesSliceXxx functions instead. GetBytesSlice is somewhat slower than GetBytesSlicePtr, but it is significantly easier to use. Calling GetBytesSlice with a negative size panics.

func GetBytesSlice128K

func GetBytesSlice128K() []byte

GetBytesSlice128K gets a byte slice with a capacity of at least 128K bytes and length of 128K bytes. GetBytesSlice128K is somewhat slower than GetBytesSlicePtr128K, but it is significantly easier to use.

func GetBytesSlice16K

func GetBytesSlice16K() []byte

GetBytesSlice16K gets a byte slice with a capacity of at least 16K bytes and length of 16K bytes. GetBytesSlice16K is somewhat slower than GetBytesSlicePtr16K, but it is significantly easier to use.

func GetBytesSlice16M

func GetBytesSlice16M() []byte

GetBytesSlice16M gets a byte slice with a capacity of at least 16M bytes and length of 16M bytes. GetBytesSlice16M is somewhat slower than GetBytesSlicePtr16M, but it is significantly easier to use.

func GetBytesSlice1K

func GetBytesSlice1K() []byte

GetBytesSlice1K gets a byte slice with a capacity of at least 1K bytes and length of 1K bytes. GetBytesSlice1K is somewhat slower than GetBytesSlicePtr1K, but it is significantly easier to use.

func GetBytesSlice1M

func GetBytesSlice1M() []byte

GetBytesSlice1M gets a byte slice with a capacity of at least 1M bytes and length of 1M bytes. GetBytesSlice1M is somewhat slower than GetBytesSlicePtr1M, but it is significantly easier to use.

func GetBytesSlice256

func GetBytesSlice256() []byte

GetBytesSlice256 gets a byte slice with a capacity of at least 256 bytes and length of 256 bytes. GetBytesSlice256 is somewhat slower than GetBytesSlicePtr256, but it is significantly easier to use.

func GetBytesSlice256K

func GetBytesSlice256K() []byte

GetBytesSlice256K gets a byte slice with a capacity of at least 256K bytes and length of 256K bytes. GetBytesSlice256K is somewhat slower than GetBytesSlicePtr256K, but it is significantly easier to use.

func GetBytesSlice2K

func GetBytesSlice2K() []byte

GetBytesSlice2K gets a byte slice with a capacity of at least 2K bytes and length of 2K bytes. GetBytesSlice2K is somewhat slower than GetBytesSlicePtr2K, but it is significantly easier to use.

func GetBytesSlice2M

func GetBytesSlice2M() []byte

GetBytesSlice2M gets a byte slice with a capacity of at least 2M bytes and length of 2M bytes. GetBytesSlice2M is somewhat slower than GetBytesSlicePtr2M, but it is significantly easier to use.

func GetBytesSlice32K

func GetBytesSlice32K() []byte

GetBytesSlice32K gets a byte slice with a capacity of at least 32K bytes and length of 32K bytes. GetBytesSlice32K is somewhat slower than GetBytesSlicePtr32K, but it is significantly easier to use.

func GetBytesSlice4K

func GetBytesSlice4K() []byte

GetBytesSlice4K gets a byte slice with a capacity of at least 4K bytes and length of 4K bytes. GetBytesSlice4K is somewhat slower than GetBytesSlicePtr4K, but it is significantly easier to use.

func GetBytesSlice4M

func GetBytesSlice4M() []byte

GetBytesSlice4M gets a byte slice with a capacity of at least 4M bytes and length of 4M bytes. GetBytesSlice4M is somewhat slower than GetBytesSlicePtr4M, but it is significantly easier to use.

func GetBytesSlice512

func GetBytesSlice512() []byte

GetBytesSlice512 gets a byte slice with a capacity of at least 512 bytes and length of 512 bytes. GetBytesSlice512 is somewhat slower than GetBytesSlicePtr512, but it is significantly easier to use.

func GetBytesSlice512K

func GetBytesSlice512K() []byte

GetBytesSlice512K gets a byte slice with a capacity of at least 512K bytes and length of 512K bytes. GetBytesSlice512K is somewhat slower than GetBytesSlicePtr512K, but it is significantly easier to use.

func GetBytesSlice64K

func GetBytesSlice64K() []byte

GetBytesSlice64K gets a byte slice with a capacity of at least 64K bytes and length of 64K bytes. GetBytesSlice64K is somewhat slower than GetBytesSlicePtr64K, but it is significantly easier to use.

func GetBytesSlice8K

func GetBytesSlice8K() []byte

GetBytesSlice8K gets a byte slice with a capacity of at least 8K bytes and length of 8K bytes. GetBytesSlice8K is somewhat slower than GetBytesSlicePtr8K, but it is significantly easier to use.

func GetBytesSlice8M

func GetBytesSlice8M() []byte

GetBytesSlice8M gets a byte slice with a capacity of at least 8M bytes and length of 8M bytes. GetBytesSlice8M is somewhat slower than GetBytesSlicePtr8M, but it is significantly easier to use.

func GetBytesSlicePtr

func GetBytesSlicePtr(size int) *[]byte

GetBytesSlicePtr is like GetBytesSlice but returns a pointer to the byte slice. GetBytesSlicePtr is somewhat faster than GetBytesSlice, but it is significantly more complicated to use, as you need to provide to PutBytesSlicePtr the original pointer returned by GetBytesSlicePtr to recycle the slice.

func GetBytesSlicePtr128K

func GetBytesSlicePtr128K() *[]byte

GetBytesSlicePtr128K is like GetBytesSlice128K but returns a pointer to the slice instead. GetBytesSlicePtr128K is somewhat faster than GetBytesSlice128K, but it is significantly more complicated to use, as you need to provide to PutBytesSlicePtr128K the original pointer returned by GetBytesSlicePtr128K to recycle the slice.

func GetBytesSlicePtr16K

func GetBytesSlicePtr16K() *[]byte

GetBytesSlicePtr16K is like GetBytesSlice16K but returns a pointer to the slice instead. GetBytesSlicePtr16K is somewhat faster than GetBytesSlice16K, but it is significantly more complicated to use, as you need to provide to PutBytesSlicePtr16K the original pointer returned by GetBytesSlicePtr16K to recycle the slice.

func GetBytesSlicePtr16M

func GetBytesSlicePtr16M() *[]byte

GetBytesSlicePtr16M is like GetBytesSlice16M but returns a pointer to the slice instead. GetBytesSlicePtr16M is somewhat faster than GetBytesSlice16M, but it is significantly more complicated to use, as you need to provide to PutBytesSlicePtr16M the original pointer returned by GetBytesSlicePtr16M to recycle the slice.

func GetBytesSlicePtr1K

func GetBytesSlicePtr1K() *[]byte

GetBytesSlicePtr1K is like GetBytesSlice1K but returns a pointer to the slice instead. GetBytesSlicePtr1K is somewhat faster than GetBytesSlice1K, but it is significantly more complicated to use, as you need to provide to PutBytesSlicePtr1K the original pointer returned by GetBytesSlicePtr1K to recycle the slice.

func GetBytesSlicePtr1M

func GetBytesSlicePtr1M() *[]byte

GetBytesSlicePtr1M is like GetBytesSlice1M but returns a pointer to the slice instead. GetBytesSlicePtr1M is somewhat faster than GetBytesSlice1M, but it is significantly more complicated to use, as you need to provide to PutBytesSlicePtr1M the original pointer returned by GetBytesSlicePtr1M to recycle the slice.

func GetBytesSlicePtr256

func GetBytesSlicePtr256() *[]byte

GetBytesSlicePtr256 is like GetBytesSlice256 but returns a pointer to the slice instead. GetBytesSlicePtr256 is somewhat faster than GetBytesSlice256, but it is significantly more complicated to use, as you need to provide to PutBytesSlicePtr256 the original pointer returned by GetBytesSlicePtr256 to recycle the slice.

func GetBytesSlicePtr256K

func GetBytesSlicePtr256K() *[]byte

GetBytesSlicePtr256K is like GetBytesSlice256K but returns a pointer to the slice instead. GetBytesSlicePtr256K is somewhat faster than GetBytesSlice256K, but it is significantly more complicated to use, as you need to provide to PutBytesSlicePtr256K the original pointer returned by GetBytesSlicePtr256K to recycle the slice.

func GetBytesSlicePtr2K

func GetBytesSlicePtr2K() *[]byte

GetBytesSlicePtr2K is like GetBytesSlice2K but returns a pointer to the slice instead. GetBytesSlicePtr2K is somewhat faster than GetBytesSlice2K, but it is significantly more complicated to use, as you need to provide to PutBytesSlicePtr2K the original pointer returned by GetBytesSlicePtr2K to recycle the slice.

func GetBytesSlicePtr2M

func GetBytesSlicePtr2M() *[]byte

GetBytesSlicePtr2M is like GetBytesSlice2M but returns a pointer to the slice instead. GetBytesSlicePtr2M is somewhat faster than GetBytesSlice2M, but it is significantly more complicated to use, as you need to provide to PutBytesSlicePtr2M the original pointer returned by GetBytesSlicePtr2M to recycle the slice.

func GetBytesSlicePtr32K

func GetBytesSlicePtr32K() *[]byte

GetBytesSlicePtr32K is like GetBytesSlice32K but returns a pointer to the slice instead. GetBytesSlicePtr32K is somewhat faster than GetBytesSlice32K, but it is significantly more complicated to use, as you need to provide to PutBytesSlicePtr32K the original pointer returned by GetBytesSlicePtr32K to recycle the slice.

func GetBytesSlicePtr4K

func GetBytesSlicePtr4K() *[]byte

GetBytesSlicePtr4K is like GetBytesSlice4K but returns a pointer to the slice instead. GetBytesSlicePtr4K is somewhat faster than GetBytesSlice4K, but it is significantly more complicated to use, as you need to provide to PutBytesSlicePtr4K the original pointer returned by GetBytesSlicePtr4K to recycle the slice.

func GetBytesSlicePtr4M

func GetBytesSlicePtr4M() *[]byte

GetBytesSlicePtr4M is like GetBytesSlice4M but returns a pointer to the slice instead. GetBytesSlicePtr4M is somewhat faster than GetBytesSlice4M, but it is significantly more complicated to use, as you need to provide to PutBytesSlicePtr4M the original pointer returned by GetBytesSlicePtr4M to recycle the slice.

func GetBytesSlicePtr512

func GetBytesSlicePtr512() *[]byte

GetBytesSlicePtr512 is like GetBytesSlice512 but returns a pointer to the slice instead. GetBytesSlicePtr512 is somewhat faster than GetBytesSlice512, but it is significantly more complicated to use, as you need to provide to PutBytesSlicePtr512 the original pointer returned by GetBytesSlicePtr512 to recycle the slice.

func GetBytesSlicePtr512K

func GetBytesSlicePtr512K() *[]byte

GetBytesSlicePtr512K is like GetBytesSlice512K but returns a pointer to the slice instead. GetBytesSlicePtr512K is somewhat faster than GetBytesSlice512K, but it is significantly more complicated to use, as you need to provide to PutBytesSlicePtr512K the original pointer returned by GetBytesSlicePtr512K to recycle the slice.

func GetBytesSlicePtr64K

func GetBytesSlicePtr64K() *[]byte

GetBytesSlicePtr64K is like GetBytesSlice64K but returns a pointer to the slice instead. GetBytesSlicePtr64K is somewhat faster than GetBytesSlice64K, but it is significantly more complicated to use, as you need to provide to PutBytesSlicePtr64K the original pointer returned by GetBytesSlicePtr64K to recycle the slice.

func GetBytesSlicePtr8K

func GetBytesSlicePtr8K() *[]byte

GetBytesSlicePtr8K is like GetBytesSlice8K but returns a pointer to the slice instead. GetBytesSlicePtr8K is somewhat faster than GetBytesSlice8K, but it is significantly more complicated to use, as you need to provide to PutBytesSlicePtr8K the original pointer returned by GetBytesSlicePtr8K to recycle the slice.

func GetBytesSlicePtr8M

func GetBytesSlicePtr8M() *[]byte

GetBytesSlicePtr8M is like GetBytesSlice8M but returns a pointer to the slice instead. GetBytesSlicePtr8M is somewhat faster than GetBytesSlice8M, but it is significantly more complicated to use, as you need to provide to PutBytesSlicePtr8M the original pointer returned by GetBytesSlicePtr8M to recycle the slice.

func PutBufioReader

func PutBufioReader(r *bufio.Reader) bool

PutBufioReader recycles the passed bufio.Reader. It returns true if it's recycled, and false otherwise. If it's recycled, bufio.Reader.Reset() is called internally, so calling Reset before PutBufioReader is not required. If it is not recycled, the bufio.Reader is left untouched. After a succesfull call to PutBufioReader callers should not use the bufio.Reader anymore and drop all references to it. If you statically know the Size() of the bufio.Reader, it may be more performant to call PutBufioReaderXXX.

func PutBufioReader128K

func PutBufioReader128K(r *bufio.Reader) bool

PutBufioReader128K recycles the passed bufio.Reader. It returns true if it's recycled, and false otherwise. If it's recycled, bufio.Reader.Reset() is called internally, so calling Reset before PutBufioReader128K is not required. If it is not recycled, the bufio.Reader is left untouched. After a succesfull call to PutBufioReader128K callers should not use the bufio.Reader anymore and drop all references to it. PutBufioReader128K is optimized for bufio.Reader with Size() in the range (131072, 262144], but it accepts also other sizes.

func PutBufioReader16K

func PutBufioReader16K(r *bufio.Reader) bool

PutBufioReader16K recycles the passed bufio.Reader. It returns true if it's recycled, and false otherwise. If it's recycled, bufio.Reader.Reset() is called internally, so calling Reset before PutBufioReader16K is not required. If it is not recycled, the bufio.Reader is left untouched. After a succesfull call to PutBufioReader16K callers should not use the bufio.Reader anymore and drop all references to it. PutBufioReader16K is optimized for bufio.Reader with Size() in the range (16384, 32768], but it accepts also other sizes.

func PutBufioReader16M

func PutBufioReader16M(r *bufio.Reader) bool

PutBufioReader16M recycles the passed bufio.Reader. It returns true if it's recycled, and false otherwise. If it's recycled, bufio.Reader.Reset() is called internally, so calling Reset before PutBufioReader16M is not required. If it is not recycled, the bufio.Reader is left untouched. After a succesfull call to PutBufioReader16M callers should not use the bufio.Reader anymore and drop all references to it. PutBufioReader16M is optimized for bufio.Reader with Size() in the range (16777216, 33554432], but it accepts also other sizes.

func PutBufioReader1K

func PutBufioReader1K(r *bufio.Reader) bool

PutBufioReader1K recycles the passed bufio.Reader. It returns true if it's recycled, and false otherwise. If it's recycled, bufio.Reader.Reset() is called internally, so calling Reset before PutBufioReader1K is not required. If it is not recycled, the bufio.Reader is left untouched. After a succesfull call to PutBufioReader1K callers should not use the bufio.Reader anymore and drop all references to it. PutBufioReader1K is optimized for bufio.Reader with Size() in the range (1024, 2048], but it accepts also other sizes.

func PutBufioReader1M

func PutBufioReader1M(r *bufio.Reader) bool

PutBufioReader1M recycles the passed bufio.Reader. It returns true if it's recycled, and false otherwise. If it's recycled, bufio.Reader.Reset() is called internally, so calling Reset before PutBufioReader1M is not required. If it is not recycled, the bufio.Reader is left untouched. After a succesfull call to PutBufioReader1M callers should not use the bufio.Reader anymore and drop all references to it. PutBufioReader1M is optimized for bufio.Reader with Size() in the range (1048576, 2097152], but it accepts also other sizes.

func PutBufioReader256

func PutBufioReader256(r *bufio.Reader) bool

PutBufioReader256 recycles the passed bufio.Reader. It returns true if it's recycled, and false otherwise. If it's recycled, bufio.Reader.Reset() is called internally, so calling Reset before PutBufioReader256 is not required. If it is not recycled, the bufio.Reader is left untouched. After a succesfull call to PutBufioReader256 callers should not use the bufio.Reader anymore and drop all references to it. PutBufioReader256 is optimized for bufio.Reader with Size() in the range (256, 512], but it accepts also other sizes.

func PutBufioReader256K

func PutBufioReader256K(r *bufio.Reader) bool

PutBufioReader256K recycles the passed bufio.Reader. It returns true if it's recycled, and false otherwise. If it's recycled, bufio.Reader.Reset() is called internally, so calling Reset before PutBufioReader256K is not required. If it is not recycled, the bufio.Reader is left untouched. After a succesfull call to PutBufioReader256K callers should not use the bufio.Reader anymore and drop all references to it. PutBufioReader256K is optimized for bufio.Reader with Size() in the range (262144, 524288], but it accepts also other sizes.

func PutBufioReader2K

func PutBufioReader2K(r *bufio.Reader) bool

PutBufioReader2K recycles the passed bufio.Reader. It returns true if it's recycled, and false otherwise. If it's recycled, bufio.Reader.Reset() is called internally, so calling Reset before PutBufioReader2K is not required. If it is not recycled, the bufio.Reader is left untouched. After a succesfull call to PutBufioReader2K callers should not use the bufio.Reader anymore and drop all references to it. PutBufioReader2K is optimized for bufio.Reader with Size() in the range (2048, 4096], but it accepts also other sizes.

func PutBufioReader2M

func PutBufioReader2M(r *bufio.Reader) bool

PutBufioReader2M recycles the passed bufio.Reader. It returns true if it's recycled, and false otherwise. If it's recycled, bufio.Reader.Reset() is called internally, so calling Reset before PutBufioReader2M is not required. If it is not recycled, the bufio.Reader is left untouched. After a succesfull call to PutBufioReader2M callers should not use the bufio.Reader anymore and drop all references to it. PutBufioReader2M is optimized for bufio.Reader with Size() in the range (2097152, 4194304], but it accepts also other sizes.

func PutBufioReader32K

func PutBufioReader32K(r *bufio.Reader) bool

PutBufioReader32K recycles the passed bufio.Reader. It returns true if it's recycled, and false otherwise. If it's recycled, bufio.Reader.Reset() is called internally, so calling Reset before PutBufioReader32K is not required. If it is not recycled, the bufio.Reader is left untouched. After a succesfull call to PutBufioReader32K callers should not use the bufio.Reader anymore and drop all references to it. PutBufioReader32K is optimized for bufio.Reader with Size() in the range (32768, 65536], but it accepts also other sizes.

func PutBufioReader4K

func PutBufioReader4K(r *bufio.Reader) bool

PutBufioReader4K recycles the passed bufio.Reader. It returns true if it's recycled, and false otherwise. If it's recycled, bufio.Reader.Reset() is called internally, so calling Reset before PutBufioReader4K is not required. If it is not recycled, the bufio.Reader is left untouched. After a succesfull call to PutBufioReader4K callers should not use the bufio.Reader anymore and drop all references to it. PutBufioReader4K is optimized for bufio.Reader with Size() in the range (4096, 8192], but it accepts also other sizes.

func PutBufioReader4M

func PutBufioReader4M(r *bufio.Reader) bool

PutBufioReader4M recycles the passed bufio.Reader. It returns true if it's recycled, and false otherwise. If it's recycled, bufio.Reader.Reset() is called internally, so calling Reset before PutBufioReader4M is not required. If it is not recycled, the bufio.Reader is left untouched. After a succesfull call to PutBufioReader4M callers should not use the bufio.Reader anymore and drop all references to it. PutBufioReader4M is optimized for bufio.Reader with Size() in the range (4194304, 8388608], but it accepts also other sizes.

func PutBufioReader512

func PutBufioReader512(r *bufio.Reader) bool

PutBufioReader512 recycles the passed bufio.Reader. It returns true if it's recycled, and false otherwise. If it's recycled, bufio.Reader.Reset() is called internally, so calling Reset before PutBufioReader512 is not required. If it is not recycled, the bufio.Reader is left untouched. After a succesfull call to PutBufioReader512 callers should not use the bufio.Reader anymore and drop all references to it. PutBufioReader512 is optimized for bufio.Reader with Size() in the range (512, 1024], but it accepts also other sizes.

func PutBufioReader512K

func PutBufioReader512K(r *bufio.Reader) bool

PutBufioReader512K recycles the passed bufio.Reader. It returns true if it's recycled, and false otherwise. If it's recycled, bufio.Reader.Reset() is called internally, so calling Reset before PutBufioReader512K is not required. If it is not recycled, the bufio.Reader is left untouched. After a succesfull call to PutBufioReader512K callers should not use the bufio.Reader anymore and drop all references to it. PutBufioReader512K is optimized for bufio.Reader with Size() in the range (524288, 1048576], but it accepts also other sizes.

func PutBufioReader64K

func PutBufioReader64K(r *bufio.Reader) bool

PutBufioReader64K recycles the passed bufio.Reader. It returns true if it's recycled, and false otherwise. If it's recycled, bufio.Reader.Reset() is called internally, so calling Reset before PutBufioReader64K is not required. If it is not recycled, the bufio.Reader is left untouched. After a succesfull call to PutBufioReader64K callers should not use the bufio.Reader anymore and drop all references to it. PutBufioReader64K is optimized for bufio.Reader with Size() in the range (65536, 131072], but it accepts also other sizes.

func PutBufioReader8K

func PutBufioReader8K(r *bufio.Reader) bool

PutBufioReader8K recycles the passed bufio.Reader. It returns true if it's recycled, and false otherwise. If it's recycled, bufio.Reader.Reset() is called internally, so calling Reset before PutBufioReader8K is not required. If it is not recycled, the bufio.Reader is left untouched. After a succesfull call to PutBufioReader8K callers should not use the bufio.Reader anymore and drop all references to it. PutBufioReader8K is optimized for bufio.Reader with Size() in the range (8192, 16384], but it accepts also other sizes.

func PutBufioReader8M

func PutBufioReader8M(r *bufio.Reader) bool

PutBufioReader8M recycles the passed bufio.Reader. It returns true if it's recycled, and false otherwise. If it's recycled, bufio.Reader.Reset() is called internally, so calling Reset before PutBufioReader8M is not required. If it is not recycled, the bufio.Reader is left untouched. After a succesfull call to PutBufioReader8M callers should not use the bufio.Reader anymore and drop all references to it. PutBufioReader8M is optimized for bufio.Reader with Size() in the range (8388608, 16777216], but it accepts also other sizes.

func PutBufioWriter

func PutBufioWriter(w *bufio.Writer) bool

PutBufioWriter recycles the passed bufio.Writer. It returns true if it's recycled, and false otherwise. If it's recycled, bufio.Writer.Reset() is called internally, so calling Reset before PutBufioWriter is not required. If it is not recycled, the bufio.Writer is left untouched. After a succesfull call to PutBufioWriter callers should not use the bufio.Writer anymore and drop all references to it. If you statically know the Size() of the bufio.Writer, it may be more performant to call PutBufioWriterXXX.

func PutBufioWriter128K

func PutBufioWriter128K(w *bufio.Writer) bool

PutBufioWriter128K recycles the passed bufio.Writer. It returns true if it's recycled, and false otherwise. If it's recycled, bufio.Writer.Reset() is called internally, so calling Reset before PutBufioWriter128K is not required. If it is not recycled, the bufio.Writer is left untouched. After a succesfull call to PutBufioWriter128K callers should not use the bufio.Writer anymore and drop all references to it. PutBufioWriter128K is optimized for bufio.Writer with Size() in the range (131072, 262144], but it accepts also other sizes.

func PutBufioWriter16K

func PutBufioWriter16K(w *bufio.Writer) bool

PutBufioWriter16K recycles the passed bufio.Writer. It returns true if it's recycled, and false otherwise. If it's recycled, bufio.Writer.Reset() is called internally, so calling Reset before PutBufioWriter16K is not required. If it is not recycled, the bufio.Writer is left untouched. After a succesfull call to PutBufioWriter16K callers should not use the bufio.Writer anymore and drop all references to it. PutBufioWriter16K is optimized for bufio.Writer with Size() in the range (16384, 32768], but it accepts also other sizes.

func PutBufioWriter16M

func PutBufioWriter16M(w *bufio.Writer) bool

PutBufioWriter16M recycles the passed bufio.Writer. It returns true if it's recycled, and false otherwise. If it's recycled, bufio.Writer.Reset() is called internally, so calling Reset before PutBufioWriter16M is not required. If it is not recycled, the bufio.Writer is left untouched. After a succesfull call to PutBufioWriter16M callers should not use the bufio.Writer anymore and drop all references to it. PutBufioWriter16M is optimized for bufio.Writer with Size() in the range (16777216, 33554432], but it accepts also other sizes.

func PutBufioWriter1K

func PutBufioWriter1K(w *bufio.Writer) bool

PutBufioWriter1K recycles the passed bufio.Writer. It returns true if it's recycled, and false otherwise. If it's recycled, bufio.Writer.Reset() is called internally, so calling Reset before PutBufioWriter1K is not required. If it is not recycled, the bufio.Writer is left untouched. After a succesfull call to PutBufioWriter1K callers should not use the bufio.Writer anymore and drop all references to it. PutBufioWriter1K is optimized for bufio.Writer with Size() in the range (1024, 2048], but it accepts also other sizes.

func PutBufioWriter1M

func PutBufioWriter1M(w *bufio.Writer) bool

PutBufioWriter1M recycles the passed bufio.Writer. It returns true if it's recycled, and false otherwise. If it's recycled, bufio.Writer.Reset() is called internally, so calling Reset before PutBufioWriter1M is not required. If it is not recycled, the bufio.Writer is left untouched. After a succesfull call to PutBufioWriter1M callers should not use the bufio.Writer anymore and drop all references to it. PutBufioWriter1M is optimized for bufio.Writer with Size() in the range (1048576, 2097152], but it accepts also other sizes.

func PutBufioWriter256

func PutBufioWriter256(w *bufio.Writer) bool

PutBufioWriter256 recycles the passed bufio.Writer. It returns true if it's recycled, and false otherwise. If it's recycled, bufio.Writer.Reset() is called internally, so calling Reset before PutBufioWriter256 is not required. If it is not recycled, the bufio.Writer is left untouched. After a succesfull call to PutBufioWriter256 callers should not use the bufio.Writer anymore and drop all references to it. PutBufioWriter256 is optimized for bufio.Writer with Size() in the range (256, 512], but it accepts also other sizes.

func PutBufioWriter256K

func PutBufioWriter256K(w *bufio.Writer) bool

PutBufioWriter256K recycles the passed bufio.Writer. It returns true if it's recycled, and false otherwise. If it's recycled, bufio.Writer.Reset() is called internally, so calling Reset before PutBufioWriter256K is not required. If it is not recycled, the bufio.Writer is left untouched. After a succesfull call to PutBufioWriter256K callers should not use the bufio.Writer anymore and drop all references to it. PutBufioWriter256K is optimized for bufio.Writer with Size() in the range (262144, 524288], but it accepts also other sizes.

func PutBufioWriter2K

func PutBufioWriter2K(w *bufio.Writer) bool

PutBufioWriter2K recycles the passed bufio.Writer. It returns true if it's recycled, and false otherwise. If it's recycled, bufio.Writer.Reset() is called internally, so calling Reset before PutBufioWriter2K is not required. If it is not recycled, the bufio.Writer is left untouched. After a succesfull call to PutBufioWriter2K callers should not use the bufio.Writer anymore and drop all references to it. PutBufioWriter2K is optimized for bufio.Writer with Size() in the range (2048, 4096], but it accepts also other sizes.

func PutBufioWriter2M

func PutBufioWriter2M(w *bufio.Writer) bool

PutBufioWriter2M recycles the passed bufio.Writer. It returns true if it's recycled, and false otherwise. If it's recycled, bufio.Writer.Reset() is called internally, so calling Reset before PutBufioWriter2M is not required. If it is not recycled, the bufio.Writer is left untouched. After a succesfull call to PutBufioWriter2M callers should not use the bufio.Writer anymore and drop all references to it. PutBufioWriter2M is optimized for bufio.Writer with Size() in the range (2097152, 4194304], but it accepts also other sizes.

func PutBufioWriter32K

func PutBufioWriter32K(w *bufio.Writer) bool

PutBufioWriter32K recycles the passed bufio.Writer. It returns true if it's recycled, and false otherwise. If it's recycled, bufio.Writer.Reset() is called internally, so calling Reset before PutBufioWriter32K is not required. If it is not recycled, the bufio.Writer is left untouched. After a succesfull call to PutBufioWriter32K callers should not use the bufio.Writer anymore and drop all references to it. PutBufioWriter32K is optimized for bufio.Writer with Size() in the range (32768, 65536], but it accepts also other sizes.

func PutBufioWriter4K

func PutBufioWriter4K(w *bufio.Writer) bool

PutBufioWriter4K recycles the passed bufio.Writer. It returns true if it's recycled, and false otherwise. If it's recycled, bufio.Writer.Reset() is called internally, so calling Reset before PutBufioWriter4K is not required. If it is not recycled, the bufio.Writer is left untouched. After a succesfull call to PutBufioWriter4K callers should not use the bufio.Writer anymore and drop all references to it. PutBufioWriter4K is optimized for bufio.Writer with Size() in the range (4096, 8192], but it accepts also other sizes.

func PutBufioWriter4M

func PutBufioWriter4M(w *bufio.Writer) bool

PutBufioWriter4M recycles the passed bufio.Writer. It returns true if it's recycled, and false otherwise. If it's recycled, bufio.Writer.Reset() is called internally, so calling Reset before PutBufioWriter4M is not required. If it is not recycled, the bufio.Writer is left untouched. After a succesfull call to PutBufioWriter4M callers should not use the bufio.Writer anymore and drop all references to it. PutBufioWriter4M is optimized for bufio.Writer with Size() in the range (4194304, 8388608], but it accepts also other sizes.

func PutBufioWriter512

func PutBufioWriter512(w *bufio.Writer) bool

PutBufioWriter512 recycles the passed bufio.Writer. It returns true if it's recycled, and false otherwise. If it's recycled, bufio.Writer.Reset() is called internally, so calling Reset before PutBufioWriter512 is not required. If it is not recycled, the bufio.Writer is left untouched. After a succesfull call to PutBufioWriter512 callers should not use the bufio.Writer anymore and drop all references to it. PutBufioWriter512 is optimized for bufio.Writer with Size() in the range (512, 1024], but it accepts also other sizes.

func PutBufioWriter512K

func PutBufioWriter512K(w *bufio.Writer) bool

PutBufioWriter512K recycles the passed bufio.Writer. It returns true if it's recycled, and false otherwise. If it's recycled, bufio.Writer.Reset() is called internally, so calling Reset before PutBufioWriter512K is not required. If it is not recycled, the bufio.Writer is left untouched. After a succesfull call to PutBufioWriter512K callers should not use the bufio.Writer anymore and drop all references to it. PutBufioWriter512K is optimized for bufio.Writer with Size() in the range (524288, 1048576], but it accepts also other sizes.

func PutBufioWriter64K

func PutBufioWriter64K(w *bufio.Writer) bool

PutBufioWriter64K recycles the passed bufio.Writer. It returns true if it's recycled, and false otherwise. If it's recycled, bufio.Writer.Reset() is called internally, so calling Reset before PutBufioWriter64K is not required. If it is not recycled, the bufio.Writer is left untouched. After a succesfull call to PutBufioWriter64K callers should not use the bufio.Writer anymore and drop all references to it. PutBufioWriter64K is optimized for bufio.Writer with Size() in the range (65536, 131072], but it accepts also other sizes.

func PutBufioWriter8K

func PutBufioWriter8K(w *bufio.Writer) bool

PutBufioWriter8K recycles the passed bufio.Writer. It returns true if it's recycled, and false otherwise. If it's recycled, bufio.Writer.Reset() is called internally, so calling Reset before PutBufioWriter8K is not required. If it is not recycled, the bufio.Writer is left untouched. After a succesfull call to PutBufioWriter8K callers should not use the bufio.Writer anymore and drop all references to it. PutBufioWriter8K is optimized for bufio.Writer with Size() in the range (8192, 16384], but it accepts also other sizes.

func PutBufioWriter8M

func PutBufioWriter8M(w *bufio.Writer) bool

PutBufioWriter8M recycles the passed bufio.Writer. It returns true if it's recycled, and false otherwise. If it's recycled, bufio.Writer.Reset() is called internally, so calling Reset before PutBufioWriter8M is not required. If it is not recycled, the bufio.Writer is left untouched. After a succesfull call to PutBufioWriter8M callers should not use the bufio.Writer anymore and drop all references to it. PutBufioWriter8M is optimized for bufio.Writer with Size() in the range (8388608, 16777216], but it accepts also other sizes.

func PutBytesBuffer

func PutBytesBuffer(b *bytes.Buffer) bool

PutBytesBuffer recycles the passed bytes.Buffer. If the bytes.Buffer can not be recycled (e.g. because its capacity is too small or too big) false is returned and the bytes.Buffer is unmodified, otherwise the bytes.Buffer is recycled and true is returned. In the latter case, the caller should never use again the passed bytes.Buffer.

func PutBytesBuffer128K

func PutBytesBuffer128K(b *bytes.Buffer) bool

PutBytesBuffer128K recycles the passed bytes.Buffer. If the bytes.Buffer can not be recycled (e.g. because its capacity is too small or too big) false is returned and the bytes.Buffer is unmodified, otherwise the bytes.Buffer is recycled and true is returned. In the latter case, the caller should never use again the passed bytes.Buffer. PutBytesBuffer128K is optimized for bytes.Buffer of capacity [131072, 262144) but will accepts other sizes as well.

func PutBytesBuffer16K

func PutBytesBuffer16K(b *bytes.Buffer) bool

PutBytesBuffer16K recycles the passed bytes.Buffer. If the bytes.Buffer can not be recycled (e.g. because its capacity is too small or too big) false is returned and the bytes.Buffer is unmodified, otherwise the bytes.Buffer is recycled and true is returned. In the latter case, the caller should never use again the passed bytes.Buffer. PutBytesBuffer16K is optimized for bytes.Buffer of capacity [16384, 32768) but will accepts other sizes as well.

func PutBytesBuffer16M

func PutBytesBuffer16M(b *bytes.Buffer) bool

PutBytesBuffer16M recycles the passed bytes.Buffer. If the bytes.Buffer can not be recycled (e.g. because its capacity is too small or too big) false is returned and the bytes.Buffer is unmodified, otherwise the bytes.Buffer is recycled and true is returned. In the latter case, the caller should never use again the passed bytes.Buffer. PutBytesBuffer16M is optimized for bytes.Buffer of capacity [16777216, 33554432) but will accepts other sizes as well.

func PutBytesBuffer1K

func PutBytesBuffer1K(b *bytes.Buffer) bool

PutBytesBuffer1K recycles the passed bytes.Buffer. If the bytes.Buffer can not be recycled (e.g. because its capacity is too small or too big) false is returned and the bytes.Buffer is unmodified, otherwise the bytes.Buffer is recycled and true is returned. In the latter case, the caller should never use again the passed bytes.Buffer. PutBytesBuffer1K is optimized for bytes.Buffer of capacity [1024, 2048) but will accepts other sizes as well.

func PutBytesBuffer1M

func PutBytesBuffer1M(b *bytes.Buffer) bool

PutBytesBuffer1M recycles the passed bytes.Buffer. If the bytes.Buffer can not be recycled (e.g. because its capacity is too small or too big) false is returned and the bytes.Buffer is unmodified, otherwise the bytes.Buffer is recycled and true is returned. In the latter case, the caller should never use again the passed bytes.Buffer. PutBytesBuffer1M is optimized for bytes.Buffer of capacity [1048576, 2097152) but will accepts other sizes as well.

func PutBytesBuffer256

func PutBytesBuffer256(b *bytes.Buffer) bool

PutBytesBuffer256 recycles the passed bytes.Buffer. If the bytes.Buffer can not be recycled (e.g. because its capacity is too small or too big) false is returned and the bytes.Buffer is unmodified, otherwise the bytes.Buffer is recycled and true is returned. In the latter case, the caller should never use again the passed bytes.Buffer. PutBytesBuffer256 is optimized for bytes.Buffer of capacity [256, 512) but will accepts other sizes as well.

func PutBytesBuffer256K

func PutBytesBuffer256K(b *bytes.Buffer) bool

PutBytesBuffer256K recycles the passed bytes.Buffer. If the bytes.Buffer can not be recycled (e.g. because its capacity is too small or too big) false is returned and the bytes.Buffer is unmodified, otherwise the bytes.Buffer is recycled and true is returned. In the latter case, the caller should never use again the passed bytes.Buffer. PutBytesBuffer256K is optimized for bytes.Buffer of capacity [262144, 524288) but will accepts other sizes as well.

func PutBytesBuffer2K

func PutBytesBuffer2K(b *bytes.Buffer) bool

PutBytesBuffer2K recycles the passed bytes.Buffer. If the bytes.Buffer can not be recycled (e.g. because its capacity is too small or too big) false is returned and the bytes.Buffer is unmodified, otherwise the bytes.Buffer is recycled and true is returned. In the latter case, the caller should never use again the passed bytes.Buffer. PutBytesBuffer2K is optimized for bytes.Buffer of capacity [2048, 4096) but will accepts other sizes as well.

func PutBytesBuffer2M

func PutBytesBuffer2M(b *bytes.Buffer) bool

PutBytesBuffer2M recycles the passed bytes.Buffer. If the bytes.Buffer can not be recycled (e.g. because its capacity is too small or too big) false is returned and the bytes.Buffer is unmodified, otherwise the bytes.Buffer is recycled and true is returned. In the latter case, the caller should never use again the passed bytes.Buffer. PutBytesBuffer2M is optimized for bytes.Buffer of capacity [2097152, 4194304) but will accepts other sizes as well.

func PutBytesBuffer32K

func PutBytesBuffer32K(b *bytes.Buffer) bool

PutBytesBuffer32K recycles the passed bytes.Buffer. If the bytes.Buffer can not be recycled (e.g. because its capacity is too small or too big) false is returned and the bytes.Buffer is unmodified, otherwise the bytes.Buffer is recycled and true is returned. In the latter case, the caller should never use again the passed bytes.Buffer. PutBytesBuffer32K is optimized for bytes.Buffer of capacity [32768, 65536) but will accepts other sizes as well.

func PutBytesBuffer4K

func PutBytesBuffer4K(b *bytes.Buffer) bool

PutBytesBuffer4K recycles the passed bytes.Buffer. If the bytes.Buffer can not be recycled (e.g. because its capacity is too small or too big) false is returned and the bytes.Buffer is unmodified, otherwise the bytes.Buffer is recycled and true is returned. In the latter case, the caller should never use again the passed bytes.Buffer. PutBytesBuffer4K is optimized for bytes.Buffer of capacity [4096, 8192) but will accepts other sizes as well.

func PutBytesBuffer4M

func PutBytesBuffer4M(b *bytes.Buffer) bool

PutBytesBuffer4M recycles the passed bytes.Buffer. If the bytes.Buffer can not be recycled (e.g. because its capacity is too small or too big) false is returned and the bytes.Buffer is unmodified, otherwise the bytes.Buffer is recycled and true is returned. In the latter case, the caller should never use again the passed bytes.Buffer. PutBytesBuffer4M is optimized for bytes.Buffer of capacity [4194304, 8388608) but will accepts other sizes as well.

func PutBytesBuffer512

func PutBytesBuffer512(b *bytes.Buffer) bool

PutBytesBuffer512 recycles the passed bytes.Buffer. If the bytes.Buffer can not be recycled (e.g. because its capacity is too small or too big) false is returned and the bytes.Buffer is unmodified, otherwise the bytes.Buffer is recycled and true is returned. In the latter case, the caller should never use again the passed bytes.Buffer. PutBytesBuffer512 is optimized for bytes.Buffer of capacity [512, 1024) but will accepts other sizes as well.

func PutBytesBuffer512K

func PutBytesBuffer512K(b *bytes.Buffer) bool

PutBytesBuffer512K recycles the passed bytes.Buffer. If the bytes.Buffer can not be recycled (e.g. because its capacity is too small or too big) false is returned and the bytes.Buffer is unmodified, otherwise the bytes.Buffer is recycled and true is returned. In the latter case, the caller should never use again the passed bytes.Buffer. PutBytesBuffer512K is optimized for bytes.Buffer of capacity [524288, 1048576) but will accepts other sizes as well.

func PutBytesBuffer64K

func PutBytesBuffer64K(b *bytes.Buffer) bool

PutBytesBuffer64K recycles the passed bytes.Buffer. If the bytes.Buffer can not be recycled (e.g. because its capacity is too small or too big) false is returned and the bytes.Buffer is unmodified, otherwise the bytes.Buffer is recycled and true is returned. In the latter case, the caller should never use again the passed bytes.Buffer. PutBytesBuffer64K is optimized for bytes.Buffer of capacity [65536, 131072) but will accepts other sizes as well.

func PutBytesBuffer8K

func PutBytesBuffer8K(b *bytes.Buffer) bool

PutBytesBuffer8K recycles the passed bytes.Buffer. If the bytes.Buffer can not be recycled (e.g. because its capacity is too small or too big) false is returned and the bytes.Buffer is unmodified, otherwise the bytes.Buffer is recycled and true is returned. In the latter case, the caller should never use again the passed bytes.Buffer. PutBytesBuffer8K is optimized for bytes.Buffer of capacity [8192, 16384) but will accepts other sizes as well.

func PutBytesBuffer8M

func PutBytesBuffer8M(b *bytes.Buffer) bool

PutBytesBuffer8M recycles the passed bytes.Buffer. If the bytes.Buffer can not be recycled (e.g. because its capacity is too small or too big) false is returned and the bytes.Buffer is unmodified, otherwise the bytes.Buffer is recycled and true is returned. In the latter case, the caller should never use again the passed bytes.Buffer. PutBytesBuffer8M is optimized for bytes.Buffer of capacity [8388608, 16777216) but will accepts other sizes as well.

func PutBytesSlice

func PutBytesSlice(b []byte) bool

func PutBytesSlice128K

func PutBytesSlice128K(p []byte) bool

PutBytesSlice128K recycles the passed byte slice. If the byte slice can not be recycled (e.g. because its capacity is too small or too big) false is returned and the bytes.Buffer is returned unmodified, otherwise the byte slice is recycled and true is returned. In the latter case, the caller should never use again the passed byte slice. PutBytesSlice128K is optimized for byte slice of capacity [131072, 262144) but will accepts other sizes as well. PutBytesSlice128K, contrary to PutBytesSlicePtr128K, will perform a pointer-sized allocation for each call.

func PutBytesSlice16K

func PutBytesSlice16K(p []byte) bool

PutBytesSlice16K recycles the passed byte slice. If the byte slice can not be recycled (e.g. because its capacity is too small or too big) false is returned and the bytes.Buffer is returned unmodified, otherwise the byte slice is recycled and true is returned. In the latter case, the caller should never use again the passed byte slice. PutBytesSlice16K is optimized for byte slice of capacity [16384, 32768) but will accepts other sizes as well. PutBytesSlice16K, contrary to PutBytesSlicePtr16K, will perform a pointer-sized allocation for each call.

func PutBytesSlice16M

func PutBytesSlice16M(p []byte) bool

PutBytesSlice16M recycles the passed byte slice. If the byte slice can not be recycled (e.g. because its capacity is too small or too big) false is returned and the bytes.Buffer is returned unmodified, otherwise the byte slice is recycled and true is returned. In the latter case, the caller should never use again the passed byte slice. PutBytesSlice16M is optimized for byte slice of capacity [16777216, 33554432) but will accepts other sizes as well. PutBytesSlice16M, contrary to PutBytesSlicePtr16M, will perform a pointer-sized allocation for each call.

func PutBytesSlice1K

func PutBytesSlice1K(p []byte) bool

PutBytesSlice1K recycles the passed byte slice. If the byte slice can not be recycled (e.g. because its capacity is too small or too big) false is returned and the bytes.Buffer is returned unmodified, otherwise the byte slice is recycled and true is returned. In the latter case, the caller should never use again the passed byte slice. PutBytesSlice1K is optimized for byte slice of capacity [1024, 2048) but will accepts other sizes as well. PutBytesSlice1K, contrary to PutBytesSlicePtr1K, will perform a pointer-sized allocation for each call.

func PutBytesSlice1M

func PutBytesSlice1M(p []byte) bool

PutBytesSlice1M recycles the passed byte slice. If the byte slice can not be recycled (e.g. because its capacity is too small or too big) false is returned and the bytes.Buffer is returned unmodified, otherwise the byte slice is recycled and true is returned. In the latter case, the caller should never use again the passed byte slice. PutBytesSlice1M is optimized for byte slice of capacity [1048576, 2097152) but will accepts other sizes as well. PutBytesSlice1M, contrary to PutBytesSlicePtr1M, will perform a pointer-sized allocation for each call.

func PutBytesSlice256

func PutBytesSlice256(p []byte) bool

PutBytesSlice256 recycles the passed byte slice. If the byte slice can not be recycled (e.g. because its capacity is too small or too big) false is returned and the bytes.Buffer is returned unmodified, otherwise the byte slice is recycled and true is returned. In the latter case, the caller should never use again the passed byte slice. PutBytesSlice256 is optimized for byte slice of capacity [256, 512) but will accepts other sizes as well. PutBytesSlice256, contrary to PutBytesSlicePtr256, will perform a pointer-sized allocation for each call.

func PutBytesSlice256K

func PutBytesSlice256K(p []byte) bool

PutBytesSlice256K recycles the passed byte slice. If the byte slice can not be recycled (e.g. because its capacity is too small or too big) false is returned and the bytes.Buffer is returned unmodified, otherwise the byte slice is recycled and true is returned. In the latter case, the caller should never use again the passed byte slice. PutBytesSlice256K is optimized for byte slice of capacity [262144, 524288) but will accepts other sizes as well. PutBytesSlice256K, contrary to PutBytesSlicePtr256K, will perform a pointer-sized allocation for each call.

func PutBytesSlice2K

func PutBytesSlice2K(p []byte) bool

PutBytesSlice2K recycles the passed byte slice. If the byte slice can not be recycled (e.g. because its capacity is too small or too big) false is returned and the bytes.Buffer is returned unmodified, otherwise the byte slice is recycled and true is returned. In the latter case, the caller should never use again the passed byte slice. PutBytesSlice2K is optimized for byte slice of capacity [2048, 4096) but will accepts other sizes as well. PutBytesSlice2K, contrary to PutBytesSlicePtr2K, will perform a pointer-sized allocation for each call.

func PutBytesSlice2M

func PutBytesSlice2M(p []byte) bool

PutBytesSlice2M recycles the passed byte slice. If the byte slice can not be recycled (e.g. because its capacity is too small or too big) false is returned and the bytes.Buffer is returned unmodified, otherwise the byte slice is recycled and true is returned. In the latter case, the caller should never use again the passed byte slice. PutBytesSlice2M is optimized for byte slice of capacity [2097152, 4194304) but will accepts other sizes as well. PutBytesSlice2M, contrary to PutBytesSlicePtr2M, will perform a pointer-sized allocation for each call.

func PutBytesSlice32K

func PutBytesSlice32K(p []byte) bool

PutBytesSlice32K recycles the passed byte slice. If the byte slice can not be recycled (e.g. because its capacity is too small or too big) false is returned and the bytes.Buffer is returned unmodified, otherwise the byte slice is recycled and true is returned. In the latter case, the caller should never use again the passed byte slice. PutBytesSlice32K is optimized for byte slice of capacity [32768, 65536) but will accepts other sizes as well. PutBytesSlice32K, contrary to PutBytesSlicePtr32K, will perform a pointer-sized allocation for each call.

func PutBytesSlice4K

func PutBytesSlice4K(p []byte) bool

PutBytesSlice4K recycles the passed byte slice. If the byte slice can not be recycled (e.g. because its capacity is too small or too big) false is returned and the bytes.Buffer is returned unmodified, otherwise the byte slice is recycled and true is returned. In the latter case, the caller should never use again the passed byte slice. PutBytesSlice4K is optimized for byte slice of capacity [4096, 8192) but will accepts other sizes as well. PutBytesSlice4K, contrary to PutBytesSlicePtr4K, will perform a pointer-sized allocation for each call.

func PutBytesSlice4M

func PutBytesSlice4M(p []byte) bool

PutBytesSlice4M recycles the passed byte slice. If the byte slice can not be recycled (e.g. because its capacity is too small or too big) false is returned and the bytes.Buffer is returned unmodified, otherwise the byte slice is recycled and true is returned. In the latter case, the caller should never use again the passed byte slice. PutBytesSlice4M is optimized for byte slice of capacity [4194304, 8388608) but will accepts other sizes as well. PutBytesSlice4M, contrary to PutBytesSlicePtr4M, will perform a pointer-sized allocation for each call.

func PutBytesSlice512

func PutBytesSlice512(p []byte) bool

PutBytesSlice512 recycles the passed byte slice. If the byte slice can not be recycled (e.g. because its capacity is too small or too big) false is returned and the bytes.Buffer is returned unmodified, otherwise the byte slice is recycled and true is returned. In the latter case, the caller should never use again the passed byte slice. PutBytesSlice512 is optimized for byte slice of capacity [512, 1024) but will accepts other sizes as well. PutBytesSlice512, contrary to PutBytesSlicePtr512, will perform a pointer-sized allocation for each call.

func PutBytesSlice512K

func PutBytesSlice512K(p []byte) bool

PutBytesSlice512K recycles the passed byte slice. If the byte slice can not be recycled (e.g. because its capacity is too small or too big) false is returned and the bytes.Buffer is returned unmodified, otherwise the byte slice is recycled and true is returned. In the latter case, the caller should never use again the passed byte slice. PutBytesSlice512K is optimized for byte slice of capacity [524288, 1048576) but will accepts other sizes as well. PutBytesSlice512K, contrary to PutBytesSlicePtr512K, will perform a pointer-sized allocation for each call.

func PutBytesSlice64K

func PutBytesSlice64K(p []byte) bool

PutBytesSlice64K recycles the passed byte slice. If the byte slice can not be recycled (e.g. because its capacity is too small or too big) false is returned and the bytes.Buffer is returned unmodified, otherwise the byte slice is recycled and true is returned. In the latter case, the caller should never use again the passed byte slice. PutBytesSlice64K is optimized for byte slice of capacity [65536, 131072) but will accepts other sizes as well. PutBytesSlice64K, contrary to PutBytesSlicePtr64K, will perform a pointer-sized allocation for each call.

func PutBytesSlice8K

func PutBytesSlice8K(p []byte) bool

PutBytesSlice8K recycles the passed byte slice. If the byte slice can not be recycled (e.g. because its capacity is too small or too big) false is returned and the bytes.Buffer is returned unmodified, otherwise the byte slice is recycled and true is returned. In the latter case, the caller should never use again the passed byte slice. PutBytesSlice8K is optimized for byte slice of capacity [8192, 16384) but will accepts other sizes as well. PutBytesSlice8K, contrary to PutBytesSlicePtr8K, will perform a pointer-sized allocation for each call.

func PutBytesSlice8M

func PutBytesSlice8M(p []byte) bool

PutBytesSlice8M recycles the passed byte slice. If the byte slice can not be recycled (e.g. because its capacity is too small or too big) false is returned and the bytes.Buffer is returned unmodified, otherwise the byte slice is recycled and true is returned. In the latter case, the caller should never use again the passed byte slice. PutBytesSlice8M is optimized for byte slice of capacity [8388608, 16777216) but will accepts other sizes as well. PutBytesSlice8M, contrary to PutBytesSlicePtr8M, will perform a pointer-sized allocation for each call.

func PutBytesSlicePtr

func PutBytesSlicePtr(b *[]byte) bool

func PutBytesSlicePtr128K

func PutBytesSlicePtr128K(p *[]byte) bool

PutBytesSlicePtr128K is like PutBytesSlice128K, but it accepts a pointer to the byte slice and does not perform a pointer-sized allocation for each call.

func PutBytesSlicePtr16K

func PutBytesSlicePtr16K(p *[]byte) bool

PutBytesSlicePtr16K is like PutBytesSlice16K, but it accepts a pointer to the byte slice and does not perform a pointer-sized allocation for each call.

func PutBytesSlicePtr16M

func PutBytesSlicePtr16M(p *[]byte) bool

PutBytesSlicePtr16M is like PutBytesSlice16M, but it accepts a pointer to the byte slice and does not perform a pointer-sized allocation for each call.

func PutBytesSlicePtr1K

func PutBytesSlicePtr1K(p *[]byte) bool

PutBytesSlicePtr1K is like PutBytesSlice1K, but it accepts a pointer to the byte slice and does not perform a pointer-sized allocation for each call.

func PutBytesSlicePtr1M

func PutBytesSlicePtr1M(p *[]byte) bool

PutBytesSlicePtr1M is like PutBytesSlice1M, but it accepts a pointer to the byte slice and does not perform a pointer-sized allocation for each call.

func PutBytesSlicePtr256

func PutBytesSlicePtr256(p *[]byte) bool

PutBytesSlicePtr256 is like PutBytesSlice256, but it accepts a pointer to the byte slice and does not perform a pointer-sized allocation for each call.

func PutBytesSlicePtr256K

func PutBytesSlicePtr256K(p *[]byte) bool

PutBytesSlicePtr256K is like PutBytesSlice256K, but it accepts a pointer to the byte slice and does not perform a pointer-sized allocation for each call.

func PutBytesSlicePtr2K

func PutBytesSlicePtr2K(p *[]byte) bool

PutBytesSlicePtr2K is like PutBytesSlice2K, but it accepts a pointer to the byte slice and does not perform a pointer-sized allocation for each call.

func PutBytesSlicePtr2M

func PutBytesSlicePtr2M(p *[]byte) bool

PutBytesSlicePtr2M is like PutBytesSlice2M, but it accepts a pointer to the byte slice and does not perform a pointer-sized allocation for each call.

func PutBytesSlicePtr32K

func PutBytesSlicePtr32K(p *[]byte) bool

PutBytesSlicePtr32K is like PutBytesSlice32K, but it accepts a pointer to the byte slice and does not perform a pointer-sized allocation for each call.

func PutBytesSlicePtr4K

func PutBytesSlicePtr4K(p *[]byte) bool

PutBytesSlicePtr4K is like PutBytesSlice4K, but it accepts a pointer to the byte slice and does not perform a pointer-sized allocation for each call.

func PutBytesSlicePtr4M

func PutBytesSlicePtr4M(p *[]byte) bool

PutBytesSlicePtr4M is like PutBytesSlice4M, but it accepts a pointer to the byte slice and does not perform a pointer-sized allocation for each call.

func PutBytesSlicePtr512

func PutBytesSlicePtr512(p *[]byte) bool

PutBytesSlicePtr512 is like PutBytesSlice512, but it accepts a pointer to the byte slice and does not perform a pointer-sized allocation for each call.

func PutBytesSlicePtr512K

func PutBytesSlicePtr512K(p *[]byte) bool

PutBytesSlicePtr512K is like PutBytesSlice512K, but it accepts a pointer to the byte slice and does not perform a pointer-sized allocation for each call.

func PutBytesSlicePtr64K

func PutBytesSlicePtr64K(p *[]byte) bool

PutBytesSlicePtr64K is like PutBytesSlice64K, but it accepts a pointer to the byte slice and does not perform a pointer-sized allocation for each call.

func PutBytesSlicePtr8K

func PutBytesSlicePtr8K(p *[]byte) bool

PutBytesSlicePtr8K is like PutBytesSlice8K, but it accepts a pointer to the byte slice and does not perform a pointer-sized allocation for each call.

func PutBytesSlicePtr8M

func PutBytesSlicePtr8M(p *[]byte) bool

PutBytesSlicePtr8M is like PutBytesSlice8M, but it accepts a pointer to the byte slice and does not perform a pointer-sized allocation for each call.

Types

type BufferPool128K

type BufferPool128K struct {
	httputil.BufferPool
}

BufferPool128K is a httputil.BufferPool that provides byte slices of 128K bytes.

func (BufferPool128K) Get

func (_ BufferPool128K) Get() []byte

Get implements httputil.BufferPool.Get

func (BufferPool128K) Put

func (_ BufferPool128K) Put(b []byte)

Put implements httputil.BufferPool.Put

type BufferPool16K

type BufferPool16K struct {
	httputil.BufferPool
}

BufferPool16K is a httputil.BufferPool that provides byte slices of 16K bytes.

func (BufferPool16K) Get

func (_ BufferPool16K) Get() []byte

Get implements httputil.BufferPool.Get

func (BufferPool16K) Put

func (_ BufferPool16K) Put(b []byte)

Put implements httputil.BufferPool.Put

type BufferPool16M

type BufferPool16M struct {
	httputil.BufferPool
}

BufferPool16M is a httputil.BufferPool that provides byte slices of 16M bytes.

func (BufferPool16M) Get

func (_ BufferPool16M) Get() []byte

Get implements httputil.BufferPool.Get

func (BufferPool16M) Put

func (_ BufferPool16M) Put(b []byte)

Put implements httputil.BufferPool.Put

type BufferPool1K

type BufferPool1K struct {
	httputil.BufferPool
}

BufferPool1K is a httputil.BufferPool that provides byte slices of 1K bytes.

func (BufferPool1K) Get

func (_ BufferPool1K) Get() []byte

Get implements httputil.BufferPool.Get

func (BufferPool1K) Put

func (_ BufferPool1K) Put(b []byte)

Put implements httputil.BufferPool.Put

type BufferPool1M

type BufferPool1M struct {
	httputil.BufferPool
}

BufferPool1M is a httputil.BufferPool that provides byte slices of 1M bytes.

func (BufferPool1M) Get

func (_ BufferPool1M) Get() []byte

Get implements httputil.BufferPool.Get

func (BufferPool1M) Put

func (_ BufferPool1M) Put(b []byte)

Put implements httputil.BufferPool.Put

type BufferPool256

type BufferPool256 struct {
	httputil.BufferPool
}

BufferPool256 is a httputil.BufferPool that provides byte slices of 256 bytes.

func (BufferPool256) Get

func (_ BufferPool256) Get() []byte

Get implements httputil.BufferPool.Get

func (BufferPool256) Put

func (_ BufferPool256) Put(b []byte)

Put implements httputil.BufferPool.Put

type BufferPool256K

type BufferPool256K struct {
	httputil.BufferPool
}

BufferPool256K is a httputil.BufferPool that provides byte slices of 256K bytes.

func (BufferPool256K) Get

func (_ BufferPool256K) Get() []byte

Get implements httputil.BufferPool.Get

func (BufferPool256K) Put

func (_ BufferPool256K) Put(b []byte)

Put implements httputil.BufferPool.Put

type BufferPool2K

type BufferPool2K struct {
	httputil.BufferPool
}

BufferPool2K is a httputil.BufferPool that provides byte slices of 2K bytes.

func (BufferPool2K) Get

func (_ BufferPool2K) Get() []byte

Get implements httputil.BufferPool.Get

func (BufferPool2K) Put

func (_ BufferPool2K) Put(b []byte)

Put implements httputil.BufferPool.Put

type BufferPool2M

type BufferPool2M struct {
	httputil.BufferPool
}

BufferPool2M is a httputil.BufferPool that provides byte slices of 2M bytes.

func (BufferPool2M) Get

func (_ BufferPool2M) Get() []byte

Get implements httputil.BufferPool.Get

func (BufferPool2M) Put

func (_ BufferPool2M) Put(b []byte)

Put implements httputil.BufferPool.Put

type BufferPool32K

type BufferPool32K struct {
	httputil.BufferPool
}

BufferPool32K is a httputil.BufferPool that provides byte slices of 32K bytes.

func (BufferPool32K) Get

func (_ BufferPool32K) Get() []byte

Get implements httputil.BufferPool.Get

func (BufferPool32K) Put

func (_ BufferPool32K) Put(b []byte)

Put implements httputil.BufferPool.Put

type BufferPool4K

type BufferPool4K struct {
	httputil.BufferPool
}

BufferPool4K is a httputil.BufferPool that provides byte slices of 4K bytes.

func (BufferPool4K) Get

func (_ BufferPool4K) Get() []byte

Get implements httputil.BufferPool.Get

func (BufferPool4K) Put

func (_ BufferPool4K) Put(b []byte)

Put implements httputil.BufferPool.Put

type BufferPool4M

type BufferPool4M struct {
	httputil.BufferPool
}

BufferPool4M is a httputil.BufferPool that provides byte slices of 4M bytes.

func (BufferPool4M) Get

func (_ BufferPool4M) Get() []byte

Get implements httputil.BufferPool.Get

func (BufferPool4M) Put

func (_ BufferPool4M) Put(b []byte)

Put implements httputil.BufferPool.Put

type BufferPool512

type BufferPool512 struct {
	httputil.BufferPool
}

BufferPool512 is a httputil.BufferPool that provides byte slices of 512 bytes.

func (BufferPool512) Get

func (_ BufferPool512) Get() []byte

Get implements httputil.BufferPool.Get

func (BufferPool512) Put

func (_ BufferPool512) Put(b []byte)

Put implements httputil.BufferPool.Put

type BufferPool512K

type BufferPool512K struct {
	httputil.BufferPool
}

BufferPool512K is a httputil.BufferPool that provides byte slices of 512K bytes.

func (BufferPool512K) Get

func (_ BufferPool512K) Get() []byte

Get implements httputil.BufferPool.Get

func (BufferPool512K) Put

func (_ BufferPool512K) Put(b []byte)

Put implements httputil.BufferPool.Put

type BufferPool64K

type BufferPool64K struct {
	httputil.BufferPool
}

BufferPool64K is a httputil.BufferPool that provides byte slices of 64K bytes.

func (BufferPool64K) Get

func (_ BufferPool64K) Get() []byte

Get implements httputil.BufferPool.Get

func (BufferPool64K) Put

func (_ BufferPool64K) Put(b []byte)

Put implements httputil.BufferPool.Put

type BufferPool8K

type BufferPool8K struct {
	httputil.BufferPool
}

BufferPool8K is a httputil.BufferPool that provides byte slices of 8K bytes.

func (BufferPool8K) Get

func (_ BufferPool8K) Get() []byte

Get implements httputil.BufferPool.Get

func (BufferPool8K) Put

func (_ BufferPool8K) Put(b []byte)

Put implements httputil.BufferPool.Put

type BufferPool8M

type BufferPool8M struct {
	httputil.BufferPool
}

BufferPool8M is a httputil.BufferPool that provides byte slices of 8M bytes.

func (BufferPool8M) Get

func (_ BufferPool8M) Get() []byte

Get implements httputil.BufferPool.Get

func (BufferPool8M) Put

func (_ BufferPool8M) Put(b []byte)

Put implements httputil.BufferPool.Put

type BufferPtrPool128K

type BufferPtrPool128K struct{}

BufferPtrPool128K is like BufferPool128K, but using pointer to byte slices instead (to avoid allocations during Put). For this reason it is not compatible with httputil.BufferPool.

func (BufferPtrPool128K) Get

func (_ BufferPtrPool128K) Get() *[]byte

Get gets a byte slice from the pool. See GetBytesSlicePtr128K for details.

func (BufferPtrPool128K) Put

func (_ BufferPtrPool128K) Put(b *[]byte)

Put inserts a byte slice in the pool. See PutBytesSlicePtr128K for details.

type BufferPtrPool16K

type BufferPtrPool16K struct{}

BufferPtrPool16K is like BufferPool16K, but using pointer to byte slices instead (to avoid allocations during Put). For this reason it is not compatible with httputil.BufferPool.

func (BufferPtrPool16K) Get

func (_ BufferPtrPool16K) Get() *[]byte

Get gets a byte slice from the pool. See GetBytesSlicePtr16K for details.

func (BufferPtrPool16K) Put

func (_ BufferPtrPool16K) Put(b *[]byte)

Put inserts a byte slice in the pool. See PutBytesSlicePtr16K for details.

type BufferPtrPool16M

type BufferPtrPool16M struct{}

BufferPtrPool16M is like BufferPool16M, but using pointer to byte slices instead (to avoid allocations during Put). For this reason it is not compatible with httputil.BufferPool.

func (BufferPtrPool16M) Get

func (_ BufferPtrPool16M) Get() *[]byte

Get gets a byte slice from the pool. See GetBytesSlicePtr16M for details.

func (BufferPtrPool16M) Put

func (_ BufferPtrPool16M) Put(b *[]byte)

Put inserts a byte slice in the pool. See PutBytesSlicePtr16M for details.

type BufferPtrPool1K

type BufferPtrPool1K struct{}

BufferPtrPool1K is like BufferPool1K, but using pointer to byte slices instead (to avoid allocations during Put). For this reason it is not compatible with httputil.BufferPool.

func (BufferPtrPool1K) Get

func (_ BufferPtrPool1K) Get() *[]byte

Get gets a byte slice from the pool. See GetBytesSlicePtr1K for details.

func (BufferPtrPool1K) Put

func (_ BufferPtrPool1K) Put(b *[]byte)

Put inserts a byte slice in the pool. See PutBytesSlicePtr1K for details.

type BufferPtrPool1M

type BufferPtrPool1M struct{}

BufferPtrPool1M is like BufferPool1M, but using pointer to byte slices instead (to avoid allocations during Put). For this reason it is not compatible with httputil.BufferPool.

func (BufferPtrPool1M) Get

func (_ BufferPtrPool1M) Get() *[]byte

Get gets a byte slice from the pool. See GetBytesSlicePtr1M for details.

func (BufferPtrPool1M) Put

func (_ BufferPtrPool1M) Put(b *[]byte)

Put inserts a byte slice in the pool. See PutBytesSlicePtr1M for details.

type BufferPtrPool256

type BufferPtrPool256 struct{}

BufferPtrPool256 is like BufferPool256, but using pointer to byte slices instead (to avoid allocations during Put). For this reason it is not compatible with httputil.BufferPool.

func (BufferPtrPool256) Get

func (_ BufferPtrPool256) Get() *[]byte

Get gets a byte slice from the pool. See GetBytesSlicePtr256 for details.

func (BufferPtrPool256) Put

func (_ BufferPtrPool256) Put(b *[]byte)

Put inserts a byte slice in the pool. See PutBytesSlicePtr256 for details.

type BufferPtrPool256K

type BufferPtrPool256K struct{}

BufferPtrPool256K is like BufferPool256K, but using pointer to byte slices instead (to avoid allocations during Put). For this reason it is not compatible with httputil.BufferPool.

func (BufferPtrPool256K) Get

func (_ BufferPtrPool256K) Get() *[]byte

Get gets a byte slice from the pool. See GetBytesSlicePtr256K for details.

func (BufferPtrPool256K) Put

func (_ BufferPtrPool256K) Put(b *[]byte)

Put inserts a byte slice in the pool. See PutBytesSlicePtr256K for details.

type BufferPtrPool2K

type BufferPtrPool2K struct{}

BufferPtrPool2K is like BufferPool2K, but using pointer to byte slices instead (to avoid allocations during Put). For this reason it is not compatible with httputil.BufferPool.

func (BufferPtrPool2K) Get

func (_ BufferPtrPool2K) Get() *[]byte

Get gets a byte slice from the pool. See GetBytesSlicePtr2K for details.

func (BufferPtrPool2K) Put

func (_ BufferPtrPool2K) Put(b *[]byte)

Put inserts a byte slice in the pool. See PutBytesSlicePtr2K for details.

type BufferPtrPool2M

type BufferPtrPool2M struct{}

BufferPtrPool2M is like BufferPool2M, but using pointer to byte slices instead (to avoid allocations during Put). For this reason it is not compatible with httputil.BufferPool.

func (BufferPtrPool2M) Get

func (_ BufferPtrPool2M) Get() *[]byte

Get gets a byte slice from the pool. See GetBytesSlicePtr2M for details.

func (BufferPtrPool2M) Put

func (_ BufferPtrPool2M) Put(b *[]byte)

Put inserts a byte slice in the pool. See PutBytesSlicePtr2M for details.

type BufferPtrPool32K

type BufferPtrPool32K struct{}

BufferPtrPool32K is like BufferPool32K, but using pointer to byte slices instead (to avoid allocations during Put). For this reason it is not compatible with httputil.BufferPool.

func (BufferPtrPool32K) Get

func (_ BufferPtrPool32K) Get() *[]byte

Get gets a byte slice from the pool. See GetBytesSlicePtr32K for details.

func (BufferPtrPool32K) Put

func (_ BufferPtrPool32K) Put(b *[]byte)

Put inserts a byte slice in the pool. See PutBytesSlicePtr32K for details.

type BufferPtrPool4K

type BufferPtrPool4K struct{}

BufferPtrPool4K is like BufferPool4K, but using pointer to byte slices instead (to avoid allocations during Put). For this reason it is not compatible with httputil.BufferPool.

func (BufferPtrPool4K) Get

func (_ BufferPtrPool4K) Get() *[]byte

Get gets a byte slice from the pool. See GetBytesSlicePtr4K for details.

func (BufferPtrPool4K) Put

func (_ BufferPtrPool4K) Put(b *[]byte)

Put inserts a byte slice in the pool. See PutBytesSlicePtr4K for details.

type BufferPtrPool4M

type BufferPtrPool4M struct{}

BufferPtrPool4M is like BufferPool4M, but using pointer to byte slices instead (to avoid allocations during Put). For this reason it is not compatible with httputil.BufferPool.

func (BufferPtrPool4M) Get

func (_ BufferPtrPool4M) Get() *[]byte

Get gets a byte slice from the pool. See GetBytesSlicePtr4M for details.

func (BufferPtrPool4M) Put

func (_ BufferPtrPool4M) Put(b *[]byte)

Put inserts a byte slice in the pool. See PutBytesSlicePtr4M for details.

type BufferPtrPool512

type BufferPtrPool512 struct{}

BufferPtrPool512 is like BufferPool512, but using pointer to byte slices instead (to avoid allocations during Put). For this reason it is not compatible with httputil.BufferPool.

func (BufferPtrPool512) Get

func (_ BufferPtrPool512) Get() *[]byte

Get gets a byte slice from the pool. See GetBytesSlicePtr512 for details.

func (BufferPtrPool512) Put

func (_ BufferPtrPool512) Put(b *[]byte)

Put inserts a byte slice in the pool. See PutBytesSlicePtr512 for details.

type BufferPtrPool512K

type BufferPtrPool512K struct{}

BufferPtrPool512K is like BufferPool512K, but using pointer to byte slices instead (to avoid allocations during Put). For this reason it is not compatible with httputil.BufferPool.

func (BufferPtrPool512K) Get

func (_ BufferPtrPool512K) Get() *[]byte

Get gets a byte slice from the pool. See GetBytesSlicePtr512K for details.

func (BufferPtrPool512K) Put

func (_ BufferPtrPool512K) Put(b *[]byte)

Put inserts a byte slice in the pool. See PutBytesSlicePtr512K for details.

type BufferPtrPool64K

type BufferPtrPool64K struct{}

BufferPtrPool64K is like BufferPool64K, but using pointer to byte slices instead (to avoid allocations during Put). For this reason it is not compatible with httputil.BufferPool.

func (BufferPtrPool64K) Get

func (_ BufferPtrPool64K) Get() *[]byte

Get gets a byte slice from the pool. See GetBytesSlicePtr64K for details.

func (BufferPtrPool64K) Put

func (_ BufferPtrPool64K) Put(b *[]byte)

Put inserts a byte slice in the pool. See PutBytesSlicePtr64K for details.

type BufferPtrPool8K

type BufferPtrPool8K struct{}

BufferPtrPool8K is like BufferPool8K, but using pointer to byte slices instead (to avoid allocations during Put). For this reason it is not compatible with httputil.BufferPool.

func (BufferPtrPool8K) Get

func (_ BufferPtrPool8K) Get() *[]byte

Get gets a byte slice from the pool. See GetBytesSlicePtr8K for details.

func (BufferPtrPool8K) Put

func (_ BufferPtrPool8K) Put(b *[]byte)

Put inserts a byte slice in the pool. See PutBytesSlicePtr8K for details.

type BufferPtrPool8M

type BufferPtrPool8M struct{}

BufferPtrPool8M is like BufferPool8M, but using pointer to byte slices instead (to avoid allocations during Put). For this reason it is not compatible with httputil.BufferPool.

func (BufferPtrPool8M) Get

func (_ BufferPtrPool8M) Get() *[]byte

Get gets a byte slice from the pool. See GetBytesSlicePtr8M for details.

func (BufferPtrPool8M) Put

func (_ BufferPtrPool8M) Put(b *[]byte)

Put inserts a byte slice in the pool. See PutBytesSlicePtr8M for details.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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