github.com/cockroachdb/pebble@v0.0.0-20231214172447-ab4952c5f87b/internal/fastrand/fastrand.go (about)

     1  // Copyright 2020 The LevelDB-Go and Pebble Authors. All rights reserved. Use
     2  // of this source code is governed by a BSD-style license that can be found in
     3  // the LICENSE file.
     4  
     5  package fastrand
     6  
     7  import _ "unsafe" // required by go:linkname
     8  
     9  // Uint32 returns a lock free uint32 value.
    10  //
    11  //go:linkname Uint32 runtime.fastrand
    12  func Uint32() uint32
    13  
    14  // Uint32n returns a lock free uint32 value in the interval [0, n).
    15  //
    16  //go:linkname Uint32n runtime.fastrandn
    17  func Uint32n(n uint32) uint32