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:
Keith Randall 2014-09-02 14:33:33 -07:00
parent 1d8fa7fa5d
commit 3306d119b0
10 changed files with 10 additions and 26 deletions

View file

@ -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.