MCPcopy Index your code
hub / github.com/coder/websocket / slidingWindowPool

Function slidingWindowPool

compress.go:175–190  ·  view source on GitHub ↗
(n int)

Source from the content-addressed store, hash-verified

173)
174
175func slidingWindowPool(n int) *sync.Pool {
176 swPoolMu.RLock()
177 p, ok := swPool[n]
178 swPoolMu.RUnlock()
179 if ok {
180 return p
181 }
182
183 p = &sync.Pool{}
184
185 swPoolMu.Lock()
186 swPool[n] = p
187 swPoolMu.Unlock()
188
189 return p
190}
191
192func (sw *slidingWindow) init(n int) {
193 if sw.buf != nil {

Callers 1

initMethod · 0.85

Calls 1

LockMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…