Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 40 for refill (0.6 sec)

  1. src/runtime/tracebuf.go

    //
    // Returns whether the buffer was flushed.
    func (w traceWriter) ensure(maxSize int) (traceWriter, bool) {
    	refill := w.traceBuf == nil || !w.available(maxSize)
    	if refill {
    		w = w.refill(traceNoExperiment)
    	}
    	return w, refill
    }
    
    // flush puts w.traceBuf on the queue of full buffers.
    func (w traceWriter) flush() traceWriter {
    	systemstack(func() {
    		lock(&trace.lock)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 08 17:47:01 UTC 2024
    - 6.8K bytes
    - Viewed (0)
  2. src/crypto/cipher/ofb.go

    		bufSize = blockSize
    	}
    	x := &ofb{
    		b:       b,
    		cipher:  make([]byte, blockSize),
    		out:     make([]byte, 0, bufSize),
    		outUsed: 0,
    	}
    
    	copy(x.cipher, iv)
    	return x
    }
    
    func (x *ofb) refill() {
    	bs := x.b.BlockSize()
    	remain := len(x.out) - x.outUsed
    	if remain > x.outUsed {
    		return
    	}
    	copy(x.out, x.out[x.outUsed:])
    	x.out = x.out[:cap(x.out)]
    	for remain < len(x.out)-bs {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 13 17:09:47 UTC 2023
    - 1.6K bytes
    - Viewed (0)
  3. src/runtime/traceexp.go

    //
    // Returns whether the buffer was flushed.
    func (w traceExpWriter) ensure(maxSize int) (traceExpWriter, bool) {
    	refill := w.traceBuf == nil || !w.available(maxSize)
    	if refill {
    		w.traceWriter = w.traceWriter.refill(w.exp)
    	}
    	return w, refill
    }
    
    // traceExperiment is an enumeration of the different kinds of experiments supported for tracing.
    type traceExperiment uint8
    
    const (
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 08 17:47:01 UTC 2024
    - 2.4K bytes
    - Viewed (0)
  4. src/internal/chacha8rand/chacha8.go

    	s.seed = seed
    	block(&s.seed, &s.buf, 0)
    	s.c = 0
    	s.i = 0
    	s.n = chunk
    }
    
    // Refill refills the state with more random values.
    // After a call to Refill, an immediate call to Next will succeed
    // (unless multiple goroutines are incorrectly sharing a state).
    func (s *State) Refill() {
    	s.c += ctrInc
    	if s.c == ctrMax {
    		// Reseed with generated uint64s for forward secrecy.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 13 21:47:29 UTC 2024
    - 4.4K bytes
    - Viewed (0)
  5. src/crypto/cipher/ctr.go

    	if bufSize < block.BlockSize() {
    		bufSize = block.BlockSize()
    	}
    	return &ctr{
    		b:       block,
    		ctr:     bytes.Clone(iv),
    		out:     make([]byte, 0, bufSize),
    		outUsed: 0,
    	}
    }
    
    func (x *ctr) refill() {
    	remain := len(x.out) - x.outUsed
    	copy(x.out, x.out[x.outUsed:])
    	x.out = x.out[:cap(x.out)]
    	bs := x.b.BlockSize()
    	for remain <= len(x.out)-bs {
    		x.b.Encrypt(x.out[remain:], x.ctr)
    		remain += bs
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 13 17:09:47 UTC 2023
    - 2.2K bytes
    - Viewed (0)
  6. src/crypto/aes/ctr_s390x.go

    	}
    	var ac aesctr
    	ac.block = c
    	ac.ctr[0] = byteorder.BeUint64(iv[0:]) // high bits
    	ac.ctr[1] = byteorder.BeUint64(iv[8:]) // low bits
    	ac.buffer = ac.storage[:0]
    	return &ac
    }
    
    func (c *aesctr) refill() {
    	// Fill up the buffer with an incrementing count.
    	c.buffer = c.storage[:streamBufferSize]
    	c0, c1 := c.ctr[0], c.ctr[1]
    	for i := 0; i < streamBufferSize; i += 16 {
    		byteorder.BePutUint64(c.buffer[i+0:], c0)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 13 18:57:38 UTC 2024
    - 2.4K bytes
    - Viewed (0)
  7. src/runtime/rand.go

    		// so we don't need to use mp.locks
    		// on the fast path, which is that the
    		// first attempt succeeds.
    		x, ok := c.Next()
    		if ok {
    			return x
    		}
    		mp.locks++ // hold m even though c.Refill may do stack split checks
    		c.Refill()
    		mp.locks--
    	}
    }
    
    // mrandinit initializes the random state of an m.
    func mrandinit(mp *m) {
    	var seed [4]uint64
    	for i := range seed {
    		seed[i] = bootstrapRand()
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 31 14:32:47 UTC 2024
    - 8K bytes
    - Viewed (0)
  8. src/internal/chacha8rand/rand_test.go

    	var s State
    	s.Init(seed)
    	for i := range output {
    		for {
    			x, ok := s.Next()
    			if ok {
    				if x != output[i] {
    					t.Errorf("#%d: have %#x want %#x", i, x, output[i])
    				}
    				break
    			}
    			s.Refill()
    		}
    	}
    }
    
    func TestMarshal(t *testing.T) {
    	var s State
    	s.Init(seed)
    	for i := range output {
    		for {
    			b := Marshal(&s)
    			s = State{}
    			err := Unmarshal(&s, b)
    			if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Dec 05 20:34:30 UTC 2023
    - 9.4K bytes
    - Viewed (0)
  9. src/os/dir_plan9.go

    	if d == nil {
    		d = new(dirInfo)
    		file.dirinfo.Store(d)
    	}
    	d.mu.Lock()
    	defer d.mu.Unlock()
    
    	size := n
    	if size <= 0 {
    		size = 100
    		n = -1
    	}
    	for n != 0 {
    		// Refill the buffer if necessary.
    		if d.bufp >= d.nbuf {
    			nb, err := file.Read(d.buf[:])
    
    			// Update the buffer state before checking for errors.
    			d.bufp, d.nbuf = 0, nb
    
    			if err != nil {
    				if err == io.EOF {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 15 20:52:06 UTC 2024
    - 2.1K bytes
    - Viewed (0)
  10. src/math/rand/v2/chacha8.go

    	c.readBuf = [8]byte{}
    }
    
    // Uint64 returns a uniformly distributed random uint64 value.
    func (c *ChaCha8) Uint64() uint64 {
    	for {
    		x, ok := c.state.Next()
    		if ok {
    			return x
    		}
    		c.state.Refill()
    	}
    }
    
    // Read reads exactly len(p) bytes into p.
    // It always returns len(p) and a nil error.
    //
    // If calls to Read and Uint64 are interleaved, the order in which bits are
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 22:09:08 UTC 2024
    - 2.8K bytes
    - Viewed (0)
Back to top