Source File
decode_typgen.go
Belonging Package
github.com/vmihailenco/msgpack/v5
package msgpackimport ()var cachedValues struct {m map[reflect.Type]chan reflect.Valuesync.RWMutex}func cachedValue( reflect.Type) reflect.Value {cachedValues.RLock():= cachedValues.m[]cachedValues.RUnlock()if != nil {return <-}cachedValues.Lock()defer cachedValues.Unlock()if = cachedValues.m[]; != nil {return <-}= make(chan reflect.Value, 256)go func() {for {<- reflect.New()}}()if cachedValues.m == nil {cachedValues.m = make(map[reflect.Type]chan reflect.Value, 8)}cachedValues.m[] =return <-}func ( *Decoder) ( reflect.Type) reflect.Value {if .flags&usePreallocateValues == 0 {return reflect.New()}return cachedValue()}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |