/
githubmirror
/
traefik
Обзор
Документация
Войти
/
githubmirror
/
traefik
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
pkg/proxy/httputil/bufferpool.go
29 строк
395 B
mmatur
Merge current v2.11 into v3.6
16 янв 2026, 11:13
Не верифицирован
16 янв 2026, 11:13
3315a9f
Код
Авторство
О чём код?
package httputil import "sync" const bufferSize = 32 * 1024 type bufferPool struct { pool sync.Pool } func newBufferPool() *bufferPool { b := &bufferPool{ pool: sync.Pool{}, } b.pool.New = func() any { return make([]byte, bufferSize) } return b } func (b *bufferPool) Get() []byte { return b.pool.Get().([]byte) } func (b *bufferPool) Put(bytes []byte) { b.pool.Put(bytes) }