<feed xmlns='http://www.w3.org/2005/Atom'>
<title>go/src/runtime/atomic_pointer.go, branch json-isValidNumber</title>
<subtitle>Fork of Go programming language with my patches.</subtitle>
<id>http://git.kilabit.info/go/atom?h=json-isValidNumber</id>
<link rel='self' href='http://git.kilabit.info/go/atom?h=json-isValidNumber'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/'/>
<updated>2023-02-17T22:19:26Z</updated>
<entry>
<title>runtime: remove the restriction that write barrier ptrs come in pairs</title>
<updated>2023-02-17T22:19:26Z</updated>
<author>
<name>Keith Randall</name>
<email>khr@golang.org</email>
</author>
<published>2022-10-26T00:58:07Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=d3daeb5267b626db36adf2f39c36f6caf94447e3'/>
<id>urn:sha1:d3daeb5267b626db36adf2f39c36f6caf94447e3</id>
<content type='text'>
Future CLs will remove the invariant that pointers are always put in
the write barrier in pairs.

The behavior of the assembly code changes a bit, where instead of writing
the pointers unconditionally and then checking for overflow, check for
overflow first and then write the pointers.

Also changed the write barrier flush function to not take the src/dst
as arguments.

Change-Id: I2ef708038367b7b82ea67cbaf505a1d5904c775c
Reviewed-on: https://go-review.googlesource.com/c/go/+/447779
Run-TryBot: Keith Randall &lt;khr@golang.org&gt;
Reviewed-by: Cherry Mui &lt;cherryyz@google.com&gt;
Reviewed-by: Michael Knyszek &lt;mknyszek@google.com&gt;
TryBot-Bypass: Keith Randall &lt;khr@golang.org&gt;
</content>
</entry>
<entry>
<title>runtime: reimplement GODEBUG=cgocheck=2 as a GOEXPERIMENT</title>
<updated>2023-02-16T00:16:24Z</updated>
<author>
<name>Keith Randall</name>
<email>khr@golang.org</email>
</author>
<published>2022-10-20T21:20:41Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=55044288ad22f0c46ac55375ed9ef3de1babb77c'/>
<id>urn:sha1:55044288ad22f0c46ac55375ed9ef3de1babb77c</id>
<content type='text'>
Move this knob from a binary-startup thing to a build-time thing.
This will enable followon optmizations to the write barrier.

Change-Id: Ic3323348621c76a7dc390c09ff55016b19c43018
Reviewed-on: https://go-review.googlesource.com/c/go/+/447778
Reviewed-by: Michael Knyszek &lt;mknyszek@google.com&gt;
Run-TryBot: Keith Randall &lt;khr@golang.org&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
Reviewed-by: Cherry Mui &lt;cherryyz@google.com&gt;
</content>
</entry>
<entry>
<title>runtime/internal/atomic: add write barrier-enabled pointer atomics</title>
<updated>2022-10-18T14:48:54Z</updated>
<author>
<name>Russ Cox</name>
<email>rsc@golang.org</email>
</author>
<published>2022-10-17T19:33:29Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=9fedc481ea09a0539cd2669312429ef5416a8949'/>
<id>urn:sha1:9fedc481ea09a0539cd2669312429ef5416a8949</id>
<content type='text'>
UnsafePointer.Store, UnsafePointer.CompareAndSwap were missing,
although .StoreNoWB and .CompareAndSwapNoWB existed.
Same for Pointer[T}.

Do the linkname tricks necessary to add those methods.

Change-Id: I925ee27673288accb15ebe93898f9eb01ab46a98
Reviewed-on: https://go-review.googlesource.com/c/go/+/443379
Auto-Submit: Russ Cox &lt;rsc@golang.org&gt;
Reviewed-by: Austin Clements &lt;austin@google.com&gt;
Run-TryBot: Russ Cox &lt;rsc@golang.org&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
</content>
</entry>
<entry>
<title>runtime: remove unused function casp</title>
<updated>2018-08-22T22:43:12Z</updated>
<author>
<name>Ian Lance Taylor</name>
<email>iant@golang.org</email>
</author>
<published>2018-02-12T19:22:00Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=6ebc31f9fb0ade22c605c146f651f18f9fc0b61d'/>
<id>urn:sha1:6ebc31f9fb0ade22c605c146f651f18f9fc0b61d</id>
<content type='text'>
Change-Id: I7c9c83ba236e1050e04377a7591fef7174df698b
Reviewed-on: https://go-review.googlesource.com/130415
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</content>
</entry>
<entry>
<title>runtime: eliminate all writebarrierptr* calls</title>
<updated>2018-02-13T16:34:45Z</updated>
<author>
<name>Austin Clements</name>
<email>austin@google.com</email>
</author>
<published>2018-01-15T05:00:02Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=245310883dcae717bb662b22d5b1fd07fdd59b76'/>
<id>urn:sha1:245310883dcae717bb662b22d5b1fd07fdd59b76</id>
<content type='text'>
Calls to writebarrierptr can simply be actual pointer writes. Calls to
writebarrierptr_prewrite need to go through the write barrier buffer.

Updates #22460.

Change-Id: I92cee4da98c5baa499f1977563757c76f95bf0ca
Reviewed-on: https://go-review.googlesource.com/92704
Run-TryBot: Austin Clements &lt;austin@google.com&gt;
Reviewed-by: Rick Hudson &lt;rlh@golang.org&gt;
</content>
</entry>
<entry>
<title>runtime: perform write barrier before pointer write</title>
<updated>2016-10-28T20:47:52Z</updated>
<author>
<name>Austin Clements</name>
<email>austin@google.com</email>
</author>
<published>2016-08-22T20:02:54Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=8f81dfe8b47e975b90bb4a2f8dd314d32c633176'/>
<id>urn:sha1:8f81dfe8b47e975b90bb4a2f8dd314d32c633176</id>
<content type='text'>
Currently, we perform write barriers after performing pointer writes.
At the moment, it simply doesn't matter what order this happens in, as
long as they appear atomic to GC. But both the hybrid barrier and ROC
are going to require a pre-write write barrier.

For the hybrid barrier, this is important because the barrier needs to
observe both the current value of the slot and the value that will be
written to it. (Alternatively, the caller could do the write and pass
in the old value, but it seems easier and more useful to just swap the
order of the barrier and the write.)

For ROC, this is necessary because, if the pointer write is going to
make the pointer reachable to some goroutine that it currently is not
visible to, the garbage collector must take some special action before
that pointer becomes more broadly visible.

This commits swaps pointer writes around so the write barrier occurs
before the pointer write.

The main subtlety here is bulk memory writes. Currently, these copy to
the destination first and then use the pointer bitmap of the
destination to find the copied pointers and invoke the write barrier.
This is necessary because the source may not have a pointer bitmap. To
handle these, we pass both the source and the destination to the bulk
memory barrier, which uses the pointer bitmap of the destination, but
reads the pointer values from the source.

Updates #17503.

Change-Id: I78ecc0c5c94ee81c29019c305b3d232069294a55
Reviewed-on: https://go-review.googlesource.com/31763
Reviewed-by: Rick Hudson &lt;rlh@golang.org&gt;
</content>
</entry>
<entry>
<title>sync/atomic: don't atomically write pointers twice</title>
<updated>2016-04-14T21:13:26Z</updated>
<author>
<name>Austin Clements</name>
<email>austin@google.com</email>
</author>
<published>2016-04-13T19:12:32Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=7c7081f514c9ec4820a842f7ef07394df4d41bab'/>
<id>urn:sha1:7c7081f514c9ec4820a842f7ef07394df4d41bab</id>
<content type='text'>
sync/atomic.StorePointer (which is implemented in
runtime/atomic_pointer.go) writes the pointer twice (through two
completely different code paths, no less). Fix it to only write once.

Change-Id: Id3b2aef9aa9081c2cf096833e001b93d3dd1f5da
Reviewed-on: https://go-review.googlesource.com/21999
Run-TryBot: Austin Clements &lt;austin@google.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
Reviewed-by: Michael Matloob &lt;matloob@golang.org&gt;
Reviewed-by: Rick Hudson &lt;rlh@golang.org&gt;
</content>
</entry>
<entry>
<title>runtime: make sync_atomic_SwapPointer signature match sync/atomic</title>
<updated>2016-04-14T21:13:23Z</updated>
<author>
<name>Austin Clements</name>
<email>austin@google.com</email>
</author>
<published>2016-04-13T19:06:01Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=8f6c35de2f7c972a4f34efddd21281b7060c4457'/>
<id>urn:sha1:8f6c35de2f7c972a4f34efddd21281b7060c4457</id>
<content type='text'>
SwapPointer is declared as

  func SwapPointer(addr *unsafe.Pointer, new unsafe.Pointer) (old unsafe.Pointer)

in sync/atomic, but defined in the runtime (where it's actually
implemented) as

  func sync_atomic_SwapPointer(ptr unsafe.Pointer, new unsafe.Pointer) unsafe.Pointer

Make ptr a *unsafe.Pointer in the runtime definition to match the type
in sync/atomic.

Change-Id: I99bab651b995001bbe54f9e790fdef2417ef0e9e
Reviewed-on: https://go-review.googlesource.com/21998
Run-TryBot: Austin Clements &lt;austin@google.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
Reviewed-by: Michael Matloob &lt;matloob@golang.org&gt;
</content>
</entry>
<entry>
<title>runtime/internal/atomic: rename Storep1 to StorepNoWB</title>
<updated>2016-04-13T19:17:25Z</updated>
<author>
<name>Austin Clements</name>
<email>austin@google.com</email>
</author>
<published>2016-04-13T15:22:42Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=4721ea6abcde318a2f5d61ec249cde5e9c57ebea'/>
<id>urn:sha1:4721ea6abcde318a2f5d61ec249cde5e9c57ebea</id>
<content type='text'>
Make it clear that the point of this function stores a pointer
*without* a write barrier.

sed -i -e 's/Storep1/StorepNoWB/' $(git grep -l Storep1)

Updates #15270.

Change-Id: Ifad7e17815e51a738070655fe3b178afdadaecf6
Reviewed-on: https://go-review.googlesource.com/21994
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
Reviewed-by: Michael Matloob &lt;matloob@golang.org&gt;
</content>
</entry>
<entry>
<title>runtime/internal/atomic: remove write barrier from Storep1 on s390x</title>
<updated>2016-04-13T16:06:51Z</updated>
<author>
<name>Austin Clements</name>
<email>austin@google.com</email>
</author>
<published>2016-04-13T15:13:39Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=d8e8fc292ace5ae59a0da44dfca1dd5b1a71ecf1'/>
<id>urn:sha1:d8e8fc292ace5ae59a0da44dfca1dd5b1a71ecf1</id>
<content type='text'>
atomic.Storep1 is not supposed to invoke a write barrier (that's what
atomicstorep is for), but currently does on s390x. This causes a panic
in runtime.mapzero when it tries to use atomic.Storep1 to store what's
actually a scalar.

Fix this by eliminating the write barrier from atomic.Storep1 on
s390x. Also add some documentation to atomicstorep to explain the
difference between these.

Fixes #15270.

Change-Id: I291846732d82f090a218df3ef6351180aff54e81
Reviewed-on: https://go-review.googlesource.com/21993
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
Run-TryBot: Austin Clements &lt;austin@google.com&gt;
Reviewed-by: Michael Munday &lt;munday@ca.ibm.com&gt;
</content>
</entry>
</feed>
