Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for mrandinit (0.24 sec)

  1. src/runtime/rand.go

    	lock  mutex
    	seed  [32]byte
    	state chacha8rand.State
    	init  bool
    }
    
    var readRandomFailed bool
    
    // randinit initializes the global random state.
    // It must be called before any use of grand.
    func randinit() {
    	lock(&globalRand.lock)
    	if globalRand.init {
    		fatal("randinit twice")
    	}
    
    	seed := &globalRand.seed
    	if startupRand != nil {
    		for i, c := range startupRand {
    			seed[i%len(seed)] ^= c
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 31 14:32:47 UTC 2024
    - 8K bytes
    - Viewed (0)
  2. src/math/big/gcd_test.go

    // This file implements a GCD benchmark.
    // Usage: go test math/big -test.bench GCD
    
    package big
    
    import (
    	"math/rand"
    	"testing"
    )
    
    // randInt returns a pseudo-random Int in the range [1<<(size-1), (1<<size) - 1]
    func randInt(r *rand.Rand, size uint) *Int {
    	n := new(Int).Lsh(intOne, size-1)
    	x := new(Int).Rand(r, n)
    	return x.Add(x, n) // make sure result > 1<<(size-1)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 14 19:11:43 UTC 2016
    - 2.2K bytes
    - Viewed (0)
  3. src/cmd/cgo/internal/testcshared/testdata/main0.c

    //   int8_t DidInitRun();
    //   int8_t DidMainRun();
    //   int32_t FromPkg();
    //   uint32_t Divu(uint32_t, uint32_t);
    int main(void) {
      int8_t ran_init = DidInitRun();
      if (!ran_init) {
        fprintf(stderr, "ERROR: DidInitRun returned unexpected results: %d\n",
                ran_init);
        return 1;
      }
      int8_t ran_main = DidMainRun();
      if (ran_main) {
        fprintf(stderr, "ERROR: DidMainRun returned unexpected results: %d\n",
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 1.1K bytes
    - Viewed (0)
  4. src/net/dnsclient.go

    	"golang.org/x/net/dns/dnsmessage"
    )
    
    // provided by runtime
    //
    //go:linkname runtime_rand runtime.rand
    func runtime_rand() uint64
    
    func randInt() int {
    	return int(uint(runtime_rand()) >> 1) // clear sign bit
    }
    
    func randIntn(n int) int {
    	return randInt() % n
    }
    
    // reverseaddr returns the in-addr.arpa. or ip6.arpa. hostname of the IP
    // address addr suitable for rDNS (PTR) record lookup or an error if it fails
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:16:53 UTC 2024
    - 5.7K bytes
    - Viewed (0)
  5. src/runtime/proc.go

    	if gp != gp.m.g0 {
    		callers(1, mp.createstack[:])
    	}
    
    	lock(&sched.lock)
    
    	if id >= 0 {
    		mp.id = id
    	} else {
    		mp.id = mReserveID()
    	}
    
    	mrandinit(mp)
    
    	mpreinit(mp)
    	if mp.gsignal != nil {
    		mp.gsignal.stackguard1 = mp.gsignal.stack.lo + stackGuard
    	}
    
    	// Add to allm so garbage collector doesn't free g->m
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 207.5K bytes
    - Viewed (0)
  6. src/math/big/int_test.go

    			benchmarkIntSqr(b, n)
    		})
    	}
    }
    
    func benchmarkDiv(b *testing.B, aSize, bSize int) {
    	var r = rand.New(rand.NewSource(1234))
    	aa := randInt(r, uint(aSize))
    	bb := randInt(r, uint(bSize))
    	if aa.Cmp(bb) < 0 {
    		aa, bb = bb, aa
    	}
    	x := new(Int)
    	y := new(Int)
    
    	b.ResetTimer()
    	for i := 0; i < b.N; i++ {
    		x.DivMod(aa, bb, y)
    	}
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 18:42:28 UTC 2024
    - 58.5K bytes
    - Viewed (0)
  7. src/net/dnsclient_unix.go

    	// gets set to true.
    	errServerTemporarilyMisbehaving = &temporaryError{"server misbehaving"}
    )
    
    func newRequest(q dnsmessage.Question, ad bool) (id uint16, udpReq, tcpReq []byte, err error) {
    	id = uint16(randInt())
    	b := dnsmessage.NewBuilder(make([]byte, 2, 514), dnsmessage.Header{ID: id, RecursionDesired: true, AuthenticData: ad})
    	if err := b.StartQuestions(); err != nil {
    		return 0, nil, nil, err
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Apr 14 18:23:45 UTC 2024
    - 24.5K bytes
    - Viewed (0)
  8. cmd/server_test.go

    	// generate a random number between 13 and 200.
    	randInt := getRandomRange(13, 200, -1)
    	// write into buffer till length of the buffer is greater than the generated random number.
    	for i := 0; i <= randInt; i += 10 {
    		buffer.WriteString(data)
    	}
    	// String content which is used for put object range test.
    	putBytes := buffer.Bytes()
    	putBytes = putBytes[:randInt]
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 115.3K bytes
    - Viewed (0)
Back to top