diff options
| author | Joe Tsai <joetsai@digital-static.net> | 2021-11-02 12:01:24 -0700 |
|---|---|---|
| committer | Joseph Tsai <joetsai@digital-static.net> | 2022-03-02 17:42:53 +0000 |
| commit | 5a03cbd12a2fcaf85482f1f4d9570c064510da9b (patch) | |
| tree | d55ac3816773e4ac5e59694e29fff8dc3ce5bdd1 /src/encoding/binary/binary.go | |
| parent | 4a13f6f42ded127dc0d097f7d1f89916cbd9e729 (diff) | |
| download | go-5a03cbd12a2fcaf85482f1f4d9570c064510da9b.tar.xz | |
encoding/json: use reflect.Value.UnsafePointer over Pointer
The latter returns a uintptr, while the former returns a unsafe.Pointer.
A uintptr is unsafe if Go ever switches to a moving GC,
while a unsafe.Pointer will be properly tracked by the GC.
We do not use unsafe.Pointer for any unsafe type conversions,
and only use it for comparability purposes, which is relatively safe.
Updates #40592
Change-Id: I813e218668704b63a3043acda4331205a3835a66
Reviewed-on: https://go-review.googlesource.com/c/go/+/360855
Trust: Joseph Tsai <joetsai@digital-static.net>
Trust: Daniel Martà <mvdan@mvdan.cc>
Reviewed-by: Daniel Martà <mvdan@mvdan.cc>
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Joseph Tsai <joetsai@digital-static.net>
TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/encoding/binary/binary.go')
0 files changed, 0 insertions, 0 deletions
