MCPcopy Create free account
hub / github.com/eth-easl/dirigent / NewBufferPool

Function NewBufferPool

internal/data_plane/proxy/net/buffer_pool.go:39–46  ·  view source on GitHub ↗

NewBufferPool creates a new BufferPool. This is only safe to use in the context of a httputil.ReverseProxy, as the buffers returned via Put are not cleaned explicitly.

()

Source from the content-addressed store, hash-verified

37// of a httputil.ReverseProxy, as the buffers returned via Put are not cleaned
38// explicitly.
39func NewBufferPool() httputil.BufferPool {
40 return &bufferPool{
41 // We don't use the New function of sync.Pool here to avoid an unnecessary
42 // allocation when creating the slices. They are implicitly created in the
43 // Get function below.
44 pool: &sync.Pool{},
45 }
46}
47
48func (b *bufferPool) Get() []byte {
49 buf := b.pool.Get()

Callers 1

NewProxyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected