diff options
| author | Pouriya <pouriya.jahanbakhsh@gmail.com> | 2024-02-27 21:51:31 +0000 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2024-03-04 17:34:30 +0000 |
| commit | 4c08c125936b4ae3daff04cecf5309dd5dd1e2c5 (patch) | |
| tree | fac8b4deb533caf5caaf89b0c12ab777d2c07f39 /src/runtime/map_faststr.go | |
| parent | 566e08fc649cb8c65d2a9f0f362ce76d79e0fc4d (diff) | |
| download | go-4c08c125936b4ae3daff04cecf5309dd5dd1e2c5.tar.xz | |
runtime: use .Pointers() instead of manual checking
Change-Id: Ib78c1513616089f4942297cd17212b1b11871fd5
GitHub-Last-Rev: f97fe5b5bffffe25dc31de7964588640cb70ec41
GitHub-Pull-Request: golang/go#65819
Reviewed-on: https://go-review.googlesource.com/c/go/+/565515
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/runtime/map_faststr.go')
| -rw-r--r-- | src/runtime/map_faststr.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/runtime/map_faststr.go b/src/runtime/map_faststr.go index 19636e777f..a9898ba1ca 100644 --- a/src/runtime/map_faststr.go +++ b/src/runtime/map_faststr.go @@ -335,8 +335,8 @@ search: } // Clear key's pointer. k.str = nil - e := add(unsafe.Pointer(b), dataOffset+abi.MapBucketCount*2*goarch.PtrSize+i*uintptr(t.ValueSize)) - if t.Elem.PtrBytes != 0 { + e := add(unsafe.Pointer(b), dataOffset+abi.MapBucketCount*2*goarch.PtrSize+i*uintptr(t.ValueSize)) + if t.Elem.Pointers() { memclrHasPointers(e, t.Elem.Size_) } else { memclrNoHeapPointers(e, t.Elem.Size_) @@ -469,7 +469,7 @@ func evacuate_faststr(t *maptype, h *hmap, oldbucket uintptr) { } } // Unlink the overflow buckets & clear key/elem to help GC. - if h.flags&oldIterator == 0 && t.Bucket.PtrBytes != 0 { + if h.flags&oldIterator == 0 && t.Bucket.Pointers() { b := add(h.oldbuckets, oldbucket*uintptr(t.BucketSize)) // Preserve b.tophash because the evacuation // state is maintained there. |
