internal

package
v0.0.0-...-be5172f Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BufferPool = sync.Pool{
	New: func() interface{} {
		return bytes.NewBuffer(make([]byte, 0, 256))
	},
}

BufferPool is a sync.Pool for buffers used to write compressed data to.

View Source
var CompressPool = sync.Pool{
	New: func() interface{} {
		w, _ := flate.NewWriter(ioutil.Discard, 6)
		return w
	},
}

CompressPool is a sync.Pool for writeCloseResetter flate readers. These are pooled for connections.

View Source
var DecompressPool = sync.Pool{
	New: func() interface{} {
		return flate.NewReader(bytes.NewReader(nil))
	},
}

DecompressPool is a sync.Pool for io.ReadCloser flate readers. These are pooled for connections.

Functions

func PutAndGetStates

func PutAndGetStates(b []interface{}) []interface{}

PutAndGetStates puts the block states passed into a map and returns it if the same blocks didn't already exist. If the blocks did already exist, the original blocks are returned so that the slice passed may be garbage collected.

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