- Sort Score
- Num 10 results
- Language All
Results 1 - 3 of 3 for NewBytePoolCap (0.07 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) -
cmd/erasure-server-pool.go
} // Initialize byte pool once for all sets, bpool size is set to // setCount * setDriveCount with each memory upto blockSizeV2. buffers := bpool.NewBytePoolCap(n, blockSizeV2, blockSizeV2*2) if n >= 16384 { // pre-populate buffers only n >= 16384 which is (32Gi/2Mi) // for all setups smaller than this avoid pre-alloc. buffers.Populate() }Created: Sun Dec 28 19:28:13 GMT 2025 - Last Modified: Sun Sep 28 20:59:21 GMT 2025 - 89.2K bytes - Click Count (0)