mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/gc: fix noscan maps
Change 85e7bee introduced a bug:
it marks map buckets as noscan when key and val do not contain pointers.
However, buckets with large/outline key or val do contain pointers.
This change takes key/val size into consideration when
marking buckets as noscan.
Change-Id: I7172a0df482657be39faa59e2579dd9f209cb54d
Reviewed-on: https://go-review.googlesource.com/4901
Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
parent
2dd7a6d41f
commit
52dadc1f31
4 changed files with 60 additions and 3 deletions
|
|
@ -1659,7 +1659,8 @@ const (
|
|||
func bucketOf(ktyp, etyp *rtype) *rtype {
|
||||
// See comment on hmap.overflow in ../runtime/hashmap.go.
|
||||
var kind uint8
|
||||
if ktyp.kind&kindNoPointers != 0 && etyp.kind&kindNoPointers != 0 {
|
||||
if ktyp.kind&kindNoPointers != 0 && etyp.kind&kindNoPointers != 0 &&
|
||||
ktyp.size <= maxKeySize && etyp.size <= maxValSize {
|
||||
kind = kindNoPointers
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue