- Sort Score
- Num 10 results
- Language All
Results 1 - 2 of 2 for NewBytePoolCap (0.06 seconds)
-
internal/bpool/bpool.go
// BytePoolCap implements a leaky pool of []byte in the form of a bounded channel. type BytePoolCap struct { c chan []byte w int wcap int } // NewBytePoolCap creates a new BytePool bounded to the given maxSize, with new // byte arrays sized based on width. func NewBytePoolCap(maxSize uint64, width int, capwidth int) (bp *BytePoolCap) { if capwidth <= 0 { panic("total buffer capacity must be provided") } if capwidth < 64 {
Created: Sun Dec 28 19:28:13 GMT 2025 - Last Modified: Sun Sep 28 20:59:21 GMT 2025 - 3K bytes - Click Count (0) -
internal/bpool/bpool_test.go
package bpool import ( "testing" ) // Tests - bytePool functionality. func TestBytePool(t *testing.T) { size := uint64(4) width := 1024 capWidth := 2048 bp := NewBytePoolCap(size, width, capWidth) // Check the width if bp.Width() != width { t.Fatalf("bytepool width invalid: got %v want %v", bp.Width(), width) } // Check with width cap if bp.WidthCap() != capWidth {
Created: Sun Dec 28 19:28:13 GMT 2025 - Last Modified: Fri Aug 29 02:39:48 GMT 2025 - 2.7K bytes - Click Count (0)