MCPcopy
hub / github.com/valyala/fasthttp / acquireStacklessZstdWriter

Function acquireStacklessZstdWriter

zstd.go:44–56  ·  view source on GitHub ↗
(w io.Writer, compressLevel int)

Source from the content-addressed store, hash-verified

42}
43
44func acquireStacklessZstdWriter(w io.Writer, compressLevel int) stackless.Writer {
45 nLevel := normalizeZstdCompressLevel(compressLevel)
46 p := stacklessZstdWriterPoolMap[nLevel]
47 v := p.Get()
48 if v == nil {
49 return stackless.NewWriter(w, func(w io.Writer) stackless.Writer {
50 return acquireRealZstdWriter(w, compressLevel)
51 })
52 }
53 sw := v.(stackless.Writer)
54 sw.Reset(w)
55 return sw
56}
57
58func releaseStacklessZstdWriter(zf stackless.Writer, level int) {
59 zf.Close()

Callers 5

WriteZstdLevelFunction · 0.85
compressZstdBodyStreamFunction · 0.85
compressFileNolockMethod · 0.85

Calls 5

NewWriterFunction · 0.92
acquireRealZstdWriterFunction · 0.85
GetMethod · 0.65
ResetMethod · 0.65

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…