stringCache holds two parallel 4096-slot arrays indexed by offset%4096. entries holds admitted strings; recentMisses records the last missing offset seen at each slot so we can admit only on the second consecutive miss for the same offset (see internAt). The arrays are intentionally separate rather
| 21 | // entries than from co-locating each entry with its rarely-touched miss |
| 22 | // counter. |
| 23 | type stringCache struct { |
| 24 | entries [4096]atomic.Pointer[cacheEntry] |
| 25 | recentMisses [4096]atomic.Uint64 |
| 26 | } |
| 27 | |
| 28 | func newStringCache() *stringCache { |
| 29 | return &stringCache{} |
nothing calls this directly
no outgoing calls
no test coverage detected