diff options
| author | Austin Clements <austin@google.com> | 2016-04-17 11:42:37 -0400 |
|---|---|---|
| committer | Austin Clements <austin@google.com> | 2016-04-21 20:07:20 +0000 |
| commit | 64a26b79ac781118d4fa364f884ce8080ba97870 (patch) | |
| tree | 179c256582b9a3fbb050a21ee019f197c4e660f9 /src/runtime/malloc.go | |
| parent | 479501c14c9d36e27727bc4b4294d57c5ddc29d0 (diff) | |
| download | go-64a26b79ac781118d4fa364f884ce8080ba97870.tar.xz | |
runtime: simplify/optimize allocate-black a bit
Currently allocating black switches to the system stack (which is
probably a historical accident) and atomically updates the global
bytes marked stat. Since we're about to depend on this much more,
optimize it a bit by putting it back on the regular stack and updating
the per-P bytes marked stat, which gets lazily folded into the global
bytes marked stat.
Change-Id: Ibbe16e5382d3fd2256e4381f88af342bf7020b04
Reviewed-on: https://go-review.googlesource.com/22170
Reviewed-by: Rick Hudson <rlh@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/malloc.go')
| -rw-r--r-- | src/runtime/malloc.go | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/runtime/malloc.go b/src/runtime/malloc.go index 3f437bc02f..9e1f47e1e6 100644 --- a/src/runtime/malloc.go +++ b/src/runtime/malloc.go @@ -695,9 +695,7 @@ func mallocgc(size uintptr, typ *_type, needzero bool) unsafe.Pointer { // This may be racing with GC so do it atomically if there can be // a race marking the bit. if gcphase == _GCmarktermination || gcBlackenPromptly { - systemstack(func() { - gcmarknewobject_m(uintptr(x), size, scanSize) - }) + gcmarknewobject(uintptr(x), size, scanSize) } if raceenabled { |
