complex

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

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
}

Pool provides a sync.Pool where GC'd objects are put back into the Pool automatically.

func New

func New() *Pool

New creates

func (*Pool) Add

func (p *Pool) Add(t reflect.Type)

Add adds support for the type returned by f(). f() must create a new instance of a pointer to a struct, map or slice value. Calling this after the first call to Get() or Put() is a race condition.

func (*Pool) Bool

func (p *Pool) Bool(b bool) *bool

func (*Pool) Complex128

func (p *Pool) Complex128(c complex128) *complex128

func (*Pool) Complex64

func (p *Pool) Complex64(c complex64) *complex64

func (*Pool) Float32

func (p *Pool) Float32(f float32) *float32

func (*Pool) Float64

func (p *Pool) Float64(f float64) *float64

func (*Pool) Get

func (p *Pool) Get(t reflect.Type) interface{}

Get retrieves a value from a pool that has the type reflect.Type. This will panic if that type is an unsupported type or was not a sub type of the value that was provided by the function passed to New().

func (*Pool) Int

func (p *Pool) Int(i int) *int

func (*Pool) Int16

func (p *Pool) Int16(i int16) *int16

func (*Pool) Int32

func (p *Pool) Int32(i int32) *int32

func (*Pool) Int64

func (p *Pool) Int64(i int64) *int64

func (*Pool) Int8

func (p *Pool) Int8(i int8) *int8

func (*Pool) Put

func (p *Pool) Put(x interface{})

Put adds x to the pool.

func (*Pool) String

func (p *Pool) String(s string) *string

func (*Pool) Uint

func (p *Pool) Uint(u uint) *uint

func (*Pool) Uint16

func (p *Pool) Uint16(u uint16) *uint16

func (*Pool) Uint32

func (p *Pool) Uint32(u uint32) *uint32

func (*Pool) Uint64

func (p *Pool) Uint64(u uint64) *uint64

func (*Pool) Uint8

func (p *Pool) Uint8(u uint8) *uint8

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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