MCPcopy Create free account
hub / github.com/segmentio/encoding / loadCachedCodec

Function loadCachedCodec

proto/proto.go:159–162  ·  view source on GitHub ↗

map[unsafe.Pointer]*codec

(t reflect.Type)

Source from the content-addressed store, hash-verified

157var codecCache atomic.Value // map[unsafe.Pointer]*codec
158
159func loadCachedCodec(t reflect.Type) (*codec, map[unsafe.Pointer]*codec) {
160 cache, _ := codecCache.Load().(map[unsafe.Pointer]*codec)
161 return cache[pointer(t)], cache
162}
163
164func storeCachedCodec(newCache map[unsafe.Pointer]*codec) {
165 codecCache.Store(newCache)

Callers 1

cachedCodecOfFunction · 0.85

Calls 1

pointerFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…