diff options
Diffstat (limited to 'vendor/github.com/goccy/go-json/decode_compile_race.go')
| -rw-r--r-- | vendor/github.com/goccy/go-json/decode_compile_race.go | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/vendor/github.com/goccy/go-json/decode_compile_race.go b/vendor/github.com/goccy/go-json/decode_compile_race.go deleted file mode 100644 index a70850cf2..000000000 --- a/vendor/github.com/goccy/go-json/decode_compile_race.go +++ /dev/null @@ -1,34 +0,0 @@ -// +build race - -package json - -import ( - "sync" - "unsafe" -) - -var decMu sync.RWMutex - -func decodeCompileToGetDecoder(typ *rtype) (decoder, error) { - typeptr := uintptr(unsafe.Pointer(typ)) - if typeptr > maxTypeAddr { - return decodeCompileToGetDecoderSlowPath(typeptr, typ) - } - - index := (typeptr - baseTypeAddr) >> typeAddrShift - decMu.RLock() - if dec := cachedDecoder[index]; dec != nil { - decMu.RUnlock() - return dec, nil - } - decMu.RUnlock() - - dec, err := decodeCompileHead(typ, map[uintptr]decoder{}) - if err != nil { - return nil, err - } - decMu.Lock() - cachedDecoder[index] = dec - decMu.Unlock() - return dec, nil -} |
