mirror of
https://github.com/golang/go.git
synced 2025-11-11 14:11:04 +00:00
runtime: unify fastrand1 and fastrand2
C and Go calling conventions are now compatible, so we don't need two versions of this function. LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://golang.org/cl/139080043
This commit is contained in:
parent
1d8fa7fa5d
commit
3306d119b0
10 changed files with 10 additions and 26 deletions
|
|
@ -387,7 +387,7 @@ func profilealloc(mp *m, x unsafe.Pointer, size uintptr) {
|
|||
if rate > 0x3fffffff { // make 2*rate not overflow
|
||||
rate = 0x3fffffff
|
||||
}
|
||||
next := int32(fastrand2()) % (2 * int32(rate))
|
||||
next := int32(fastrand1()) % (2 * int32(rate))
|
||||
// Subtract the "remainder" of the current allocation.
|
||||
// Otherwise objects that are close in size to sampling rate
|
||||
// will be under-sampled, because we consistently discard this remainder.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue