Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for Fastrandn (0.65 sec)

  1. src/runtime/rand_test.go

    	// but check that all three don't return the same number (1 in 2^64 chance)
    	{
    		x, y, z := fastrand(), fastrand(), fastrand()
    		if x == y && y == z {
    			t.Fatalf("fastrand three times = %#x, %#x, %#x, want different numbers", x, y, z)
    		}
    	}
    	{
    		x, y, z := fastrandn(1e9), fastrandn(1e9), fastrandn(1e9)
    		if x == y && y == z {
    			t.Fatalf("fastrandn three times = %#x, %#x, %#x, want different numbers", x, y, z)
    		}
    	}
    	{
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Dec 07 23:44:31 UTC 2023
    - 2K bytes
    - Viewed (0)
  2. src/runtime/rand.go

    // Too much legacy code has go:linkname references
    // to runtime.fastrand and friends, so keep these around for now.
    // Code should migrate to math/rand/v2.Uint64,
    // which is just as fast, but that's only available in Go 1.22+.
    // It would be reasonable to remove these in Go 1.24.
    // Do not call these from package runtime.
    
    //go:linkname legacy_fastrand runtime.fastrand
    func legacy_fastrand() uint32 {
    	return uint32(rand())
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 31 14:32:47 UTC 2024
    - 8K bytes
    - Viewed (0)
  3. src/cmd/link/testdata/linkname/fastrand.go

    // license that can be found in the LICENSE file.
    
    // Linkname fastrand is allowed _for now_, as it has a
    // linknamed definition, for legacy reason.
    // NOTE: this may not be allowed in the future. Don't do this!
    
    package main
    
    import _ "unsafe"
    
    //go:linkname fastrand runtime.fastrand
    func fastrand() uint32
    
    func main() {
    	println(fastrand())
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 19:57:43 UTC 2024
    - 457 bytes
    - Viewed (0)
  4. src/runtime/export_test.go

    		if s.state.get() == mSpanInUse {
    			counted += s.npages
    		}
    	}
    
    	startTheWorld(stw)
    
    	return
    }
    
    func Fastrand() uint32          { return uint32(rand()) }
    func Fastrand64() uint64        { return rand() }
    func Fastrandn(n uint32) uint32 { return randn(n) }
    
    type ProfBuf profBuf
    
    func NewProfBuf(hdrsize, bufwords, tags int) *ProfBuf {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 17:50:53 UTC 2024
    - 46.1K bytes
    - Viewed (0)
  5. src/math/rand/v2/rand.go

    // convenience functions.
    var globalRand = &Rand{src: runtimeSource{}}
    
    //go:linkname runtime_rand runtime.rand
    func runtime_rand() uint64
    
    // runtimeSource is a Source that uses the runtime fastrand functions.
    type runtimeSource struct{}
    
    func (runtimeSource) Uint64() uint64 {
    	return runtime_rand()
    }
    
    // Int64 returns a non-negative pseudo-random 63-bit integer as an int64
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 02:25:49 UTC 2024
    - 12.8K bytes
    - Viewed (0)
  6. src/math/rand/rand.go

    		return globalRandGenerator.Load()
    	}
    
    	return r
    }
    
    //go:linkname runtime_rand runtime.rand
    func runtime_rand() uint64
    
    // runtimeSource is an implementation of Source64 that uses the runtime
    // fastrand functions.
    type runtimeSource struct {
    	// The mutex is used to avoid race conditions in Read.
    	mu sync.Mutex
    }
    
    func (*runtimeSource) Int63() int64 {
    	return int64(runtime_rand() & rngMask)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 22:09:08 UTC 2024
    - 16.9K bytes
    - Viewed (0)
  7. src/cmd/link/link_test.go

    		{"coro_var.go", false},
    		// assembly reference is not ok
    		{"coro_asm", false},
    		// pull-only linkname is not ok
    		{"coro2.go", false},
    		// legacy bad linkname is ok, for now
    		{"fastrand.go", true},
    		{"badlinkname.go", true},
    	}
    	for _, test := range tests {
    		test := test
    		t.Run(test.src, func(t *testing.T) {
    			t.Parallel()
    			src := filepath.Join("testdata", "linkname", test.src)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 24 20:26:02 UTC 2024
    - 43.5K bytes
    - Viewed (0)
  8. src/cmd/go/internal/modfetch/zip_sum_test/testdata/zip_sums.csv

    github.com/valyala/fasthttp,v1.6.0,h1:uWF8lgKmeaIewWVPwi4GRq2P6+R46IgYZdxWtM+GtEY=,b15a953ed5395599871097c94977d21c026205e6ca7ad6e340cd595096d5840e
    github.com/valyala/fastrand,v1.0.0,h1:LUKT9aKer2dVQNUi3waewTbKV+7H17kvWFNKs2ObdkI=,ed2166483141b4f3d59ee07975a5d91990e4c17f36c919565b8063c0cb02f7ed
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 18 17:29:01 UTC 2020
    - 334.9K bytes
    - Viewed (0)
Back to top