aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/malloc.go
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2014-09-02 14:33:33 -0700
committerKeith Randall <khr@golang.org>2014-09-02 14:33:33 -0700
commit3306d119b07e5b8b51a8ee5502bec859e62a5835 (patch)
treeaf9cab8303be75aca5e3fc83a835c1c41ebef817 /src/pkg/runtime/malloc.go
parent1d8fa7fa5db01cde6e764af29d4c2fb80bad9d8c (diff)
downloadgo-3306d119b07e5b8b51a8ee5502bec859e62a5835.tar.xz
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
Diffstat (limited to 'src/pkg/runtime/malloc.go')
-rw-r--r--src/pkg/runtime/malloc.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pkg/runtime/malloc.go b/src/pkg/runtime/malloc.go
index 5b1825a04c..84587a36d6 100644
--- a/src/pkg/runtime/malloc.go
+++ b/src/pkg/runtime/malloc.go
@@ -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.