runtime: refactor hmap.extra.overflow array into two separate fields

This makes it easier to deduce from the field names which overflow
field corresponds to h.buckets and which to h.oldbuckets by aligning
the naming with the buckets fields in hmap.

Change-Id: I8d6a729229a190db0212bac012ead1a3c13cf5d0
Reviewed-on: https://go-review.googlesource.com/62411
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
Martin Möhrmann 2017-09-10 12:55:16 +02:00
parent a4956248a8
commit 1d3ad6733e
2 changed files with 22 additions and 17 deletions

View file

@ -295,7 +295,8 @@ func hiter(t *types.Type) *types.Type {
// h *hmap
// buckets *bmap
// bptr *bmap
// overflow [2]unsafe.Pointer // [2]*[]*bmap
// overflow unsafe.Pointer // *[]*bmap
// oldoverflow unsafe.Pointer // *[]*bmap
// startBucket uintptr
// offset uint8
// wrapped bool
@ -312,7 +313,8 @@ func hiter(t *types.Type) *types.Type {
makefield("h", types.NewPtr(hmap)),
makefield("buckets", types.NewPtr(bmap)),
makefield("bptr", types.NewPtr(bmap)),
makefield("overflow", types.NewArray(types.Types[TUNSAFEPTR], 2)),
makefield("overflow", types.Types[TUNSAFEPTR]),
makefield("oldoverflow", types.Types[TUNSAFEPTR]),
makefield("startBucket", types.Types[TUINTPTR]),
makefield("offset", types.Types[TUINT8]),
makefield("wrapped", types.Types[TBOOL]),