]> Cypherpunks repositories - gostls13.git/commit
runtime: do not execute write barrier on newly allocated slice in growslice
authorMartin Möhrmann <moehrmann@google.com>
Sun, 3 Jun 2018 11:00:19 +0000 (13:00 +0200)
committerMartin Möhrmann <moehrmann@google.com>
Fri, 24 Aug 2018 08:13:47 +0000 (08:13 +0000)
commit4363c98f62e9e315ed20b12d2ce47021fd2bf7bc
tree796e10da765724eeb3fb695176a378c83c94a16a
parent96dcc4457b9aad418abc0eb4316c21fefdbf08e1
runtime: do not execute write barrier on newly allocated slice in growslice

The new slice created in growslice is cleared during malloc for
element types containing pointers and therefore can only contain
nil pointers. This change avoids executing write barriers for these
nil pointers by adding and using a special bulkBarrierPreWriteSrcOnly
function that does not enqueue pointers to slots in dst to the write
barrier buffer.

Change-Id: If9b18248bfeeb6a874b0132d19520adea593bfc4
Reviewed-on: https://go-review.googlesource.com/115996
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/runtime/mbitmap.go
src/runtime/slice.go