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

Method Get

internal/data_plane/proxy/net/buffer_pool.go:48–61  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

46}
47
48func (b *bufferPool) Get() []byte {
49 buf := b.pool.Get()
50 if buf == nil {
51 // Use the default buffer size as defined in the ReverseProxy itself.
52 return make([]byte, 32*1024)
53 }
54
55 buffer, ok := buf.(*[]byte)
56 if !ok {
57 panic("Failed to get buffer") // TODO: François Costa, is it the best way of doing?
58 }
59
60 return *buffer
61}
62
63// Put returns the given Buffer to the bufferPool.
64func (b *bufferPool) Put(buffer []byte) {

Callers

nothing calls this directly

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected