aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/malloc.go
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2015-03-12 16:53:57 -0400
committerAustin Clements <austin@google.com>2015-04-06 21:28:07 +0000
commit50a66562a067504c9a21a0ccc00f209ac78166ca (patch)
tree0a7c1e2e990faebd652d6f48144421d9d1870315 /src/runtime/malloc.go
parentdfc9e264d18a3f9fe7afdb794d227473ce486516 (diff)
downloadgo-50a66562a067504c9a21a0ccc00f209ac78166ca.tar.xz
runtime: track heap bytes marked by GC
This tracks the number of heap bytes marked by a GC cycle. We'll use this information to precisely trigger the next GC cycle. Currently this aggregates the work counter in gcWork and dispose atomically aggregates this into a global work counter. dispose happens relatively infrequently, so the contention on the global counter should be low. If this turns out to be an issue, we can reduce the number of disposes, and if it's still a problem, we can switch to per-P counters. Change-Id: I1bc377cb2e802ef61c2968602b63146d52e7f5db Reviewed-on: https://go-review.googlesource.com/8388 Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/runtime/malloc.go')
-rw-r--r--src/runtime/malloc.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/malloc.go b/src/runtime/malloc.go
index fde58e2d0c..130866ec03 100644
--- a/src/runtime/malloc.go
+++ b/src/runtime/malloc.go
@@ -648,7 +648,7 @@ func mallocgc(size uintptr, typ *_type, flags uint32) unsafe.Pointer {
// a race marking the bit.
if gcphase == _GCmarktermination {
systemstack(func() {
- gcmarknewobject_m(uintptr(x))
+ gcmarknewobject_m(uintptr(x), size)
})
}