summaryrefslogtreecommitdiff
path: root/vendor/github.com/goccy/go-json/decode_compile_race.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2021-09-10 14:42:14 +0200
committerLibravatar GitHub <noreply@github.com>2021-09-10 14:42:14 +0200
commitf2e5bedea6fb93fbbf68ed8f7153c353cc57a9f0 (patch)
tree475ae9e7470d0df670ab2a59dce351cd1d07498a /vendor/github.com/goccy/go-json/decode_compile_race.go
parentfixes + db changes (#204) (diff)
downloadgotosocial-f2e5bedea6fb93fbbf68ed8f7153c353cc57a9f0.tar.xz
migrate go version to 1.17 (#203)
* migrate go version to 1.17 * update contributing
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.go34
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
-}