Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 43 for cap (7.43 sec)

  1. internal/dsync/utils.go

    import (
    	"math/rand"
    	"time"
    )
    
    func backoffWait(min, unit, cap time.Duration) func(*rand.Rand, uint) time.Duration {
    	if unit > time.Hour {
    		// Protect against integer overflow
    		panic("unit cannot exceed one hour")
    	}
    	return func(r *rand.Rand, attempt uint) time.Duration {
    		sleep := min
    		sleep += unit * time.Duration(attempt)
    		if sleep > cap {
    			sleep = cap
    		}
    		sleep -= time.Duration(r.Float64() * float64(sleep))
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sat May 13 15:42:21 GMT 2023
    - 1.2K bytes
    - Viewed (0)
  2. cmd/xl-storage-format-v2_gen.go

    				return
    			}
    		case "EcDist":
    			var zb0003 uint32
    			zb0003, err = dc.ReadArrayHeader()
    			if err != nil {
    				err = msgp.WrapError(err, "ErasureDist")
    				return
    			}
    			if cap(z.ErasureDist) >= int(zb0003) {
    				z.ErasureDist = (z.ErasureDist)[:zb0003]
    			} else {
    				z.ErasureDist = make([]uint8, zb0003)
    			}
    			for za0003 := range z.ErasureDist {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri Apr 19 16:43:43 GMT 2024
    - 53.8K bytes
    - Viewed (0)
  3. internal/grid/types.go

    			PutByteBuffer(*b)
    		}
    		*b = nil
    		return bytes, nil
    	}
    	val, bytes, err := msgp.ReadBytesZC(bytes)
    	if err != nil {
    		return bytes, err
    	}
    	if cap(*b) >= len(val) {
    		*b = (*b)[:len(val)]
    		copy(*b, val)
    	} else {
    		if cap(*b) == 0 && len(val) <= maxBufferSize {
    			*b = GetByteBufferCap(len(val))
    		} else {
    			PutByteBuffer(*b)
    			*b = make([]byte, 0, len(val))
    		}
    		in := *b
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Mon Apr 01 23:42:09 GMT 2024
    - 15.4K bytes
    - Viewed (0)
  4. internal/bpool/bpool_test.go

    	}
    
    	// Check with width cap
    	if bufPool.WidthCap() != capWidth {
    		t.Fatalf("bytepool capWidth invalid: got %v want %v", bufPool.WidthCap(), capWidth)
    	}
    
    	// Check that retrieved buffer are of the expected width
    	b := bufPool.Get()
    	if len(b) != width {
    		t.Fatalf("bytepool length invalid: got %v want %v", len(b), width)
    	}
    	if cap(b) != capWidth {
    		t.Fatalf("bytepool cap invalid: got %v want %v", cap(b), capWidth)
    	}
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Tue Jan 30 19:13:27 GMT 2024
    - 2.6K bytes
    - Viewed (0)
  5. cmd/untar.go

    			name = pathJoin(o.prefixAll, name)
    		}
    
    		// Do small files async
    		n++
    		if header.Size <= smallFileThreshold {
    			asyncWriters <- struct{}{}
    			b := poolBuf128k.Get().([]byte)
    			if cap(b) < int(header.Size) {
    				b = make([]byte, smallFileThreshold)
    			}
    			b = b[:header.Size]
    			if _, err := io.ReadFull(tarReader, b); err != nil {
    				return err
    			}
    			wg.Add(1)
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 6K bytes
    - Viewed (0)
  6. cmd/batch-replicate_gen.go

    				return
    			}
    		case "Tags":
    			var zb0002 uint32
    			zb0002, err = dc.ReadArrayHeader()
    			if err != nil {
    				err = msgp.WrapError(err, "Tags")
    				return
    			}
    			if cap(z.Tags) >= int(zb0002) {
    				z.Tags = (z.Tags)[:zb0002]
    			} else {
    				z.Tags = make([]BatchJobKV, zb0002)
    			}
    			for za0001 := range z.Tags {
    				err = z.Tags[za0001].DecodeMsg(dc)
    				if err != nil {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Wed Nov 22 18:51:46 GMT 2023
    - 40.6K bytes
    - Viewed (0)
  7. internal/bpool/bpool.go

    		w:    width,
    		wcap: capwidth,
    	}
    }
    
    // Populate - populates and pre-warms the byte pool, this function is non-blocking.
    func (bp *BytePoolCap) Populate() {
    	for _, buf := range reedsolomon.AllocAligned(cap(bp.c), bp.wcap) {
    		bp.Put(buf[:bp.w])
    	}
    }
    
    // Get gets a []byte from the BytePool, or creates a new one if none are
    // available in the pool.
    func (bp *BytePoolCap) Get() (b []byte) {
    	if bp == nil {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri Apr 19 16:44:59 GMT 2024
    - 2.6K bytes
    - Viewed (0)
  8. internal/rest/client.go

    func exponentialBackoffWait(r *rand.Rand, unit, cap time.Duration) func(uint) time.Duration {
    	if unit > time.Hour {
    		// Protect against integer overflow
    		panic("unit cannot exceed one hour")
    	}
    	return func(attempt uint) time.Duration {
    		if attempt > 16 {
    			// Protect against integer overflow
    			attempt = 16
    		}
    		// sleep = random_between(unit, min(cap, base * 2 ** attempt))
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sun Apr 28 17:53:50 GMT 2024
    - 14.4K bytes
    - Viewed (0)
  9. cmd/background-newdisks-heal-ops_gen.go

    				return
    			}
    		case "QueuedBuckets":
    			var zb0002 uint32
    			zb0002, err = dc.ReadArrayHeader()
    			if err != nil {
    				err = msgp.WrapError(err, "QueuedBuckets")
    				return
    			}
    			if cap(z.QueuedBuckets) >= int(zb0002) {
    				z.QueuedBuckets = (z.QueuedBuckets)[:zb0002]
    			} else {
    				z.QueuedBuckets = make([]string, zb0002)
    			}
    			for za0001 := range z.QueuedBuckets {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Wed Feb 28 17:05:40 GMT 2024
    - 21.5K bytes
    - Viewed (0)
  10. internal/grid/muxclient.go

    	}
    	m.respWait = responses // Route directly to output.
    	m.respMu.Unlock()
    
    	// Try to grab an initial block.
    	m.singleResp = false
    	m.RecvSeq = m.SendSeq // Sync
    	if cap(requests) > 0 {
    		m.outBlock = make(chan struct{}, cap(requests))
    	}
    	msg := message{
    		Op:         OpConnectMux,
    		Handler:    h,
    		Payload:    payload,
    		DeadlineMS: uint32(m.deadline.Milliseconds()),
    	}
    	msg.setZeroPayloadFlag()
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 14.2K bytes
    - Viewed (0)
Back to top