]> Cypherpunks repositories - gostls13.git/commitdiff
runtime/map: update comment for gc/reflect
authorMakdon <makdon@makdon.me>
Wed, 7 Apr 2021 15:24:46 +0000 (15:24 +0000)
committerEmmanuel Odeke <emmanuel@orijtech.com>
Wed, 7 Apr 2021 18:44:30 +0000 (18:44 +0000)
update comment cause gc/reflect.go has been moved to reflectdata/reflect.go

In the commit (attach below), gc/reflect.go is moved to reflectdata/reflect.go
So the  comment referring gc/reflect.go should be updated to reflectdata/reflect.go

There maybe other places that refers gc/reflect.go that should be updated.
I would work around it soon.

commit:
https://github.com/golang/go/commit/de65151e507e7b3c8e46d74f223d7c562177bedc
https://github.com/golang/go/commit/e4895ab4c0eb44de6ddc5dc8d860a827b20d2781

Change-Id: Ieed5c48049ffe6889c08e164972fc7825653ac05
GitHub-Last-Rev: eec9c2328d0be40842c3994f26f26f03fa650a91
GitHub-Pull-Request: golang/go#45421
Reviewed-on: https://go-review.googlesource.com/c/go/+/307930
Reviewed-by: Keith Randall <khr@golang.org>
Trust: Emmanuel Odeke <emmanuel@orijtech.com>

src/cmd/compile/internal/walk/range.go
src/runtime/map.go

index 5ab24b2188404bfd8420f34314388d281f05b3da..80bd8750faef93e1de40b6c152df5505cbdea8a6 100644 (file)
@@ -168,7 +168,9 @@ func walkRange(nrange *ir.RangeStmt) ir.Node {
 
                hit := nrange.Prealloc
                th := hit.Type()
-               keysym := th.Field(0).Sym  // depends on layout of iterator struct.  See reflect.go:MapIterType
+               // depends on layout of iterator struct.
+               // See cmd/compile/internal/reflectdata/reflect.go:MapIterType
+               keysym := th.Field(0).Sym  
                elemsym := th.Field(1).Sym // ditto
 
                fn := typecheck.LookupRuntime("mapiterinit")
index 0beff57a1a51a750fc9c44ce7e34613c5f0d1527..40e19c92949d84418d11b07abc9536dcd4c962f9 100644 (file)
@@ -113,7 +113,7 @@ func isEmpty(x uint8) bool {
 
 // A header for a Go map.
 type hmap struct {
-       // Note: the format of the hmap is also encoded in cmd/compile/internal/gc/reflect.go.
+       // Note: the format of the hmap is also encoded in cmd/compile/internal/reflectdata/reflect.go.
        // Make sure this stays in sync with the compiler's definition.
        count     int // # live cells == size of map.  Must be first (used by len() builtin)
        flags     uint8
@@ -159,11 +159,11 @@ type bmap struct {
 }
 
 // A hash iteration structure.
-// If you modify hiter, also change cmd/compile/internal/gc/reflect.go to indicate
+// If you modify hiter, also change cmd/compile/internal/reflectdata/reflect.go to indicate
 // the layout of this structure.
 type hiter struct {
-       key         unsafe.Pointer // Must be in first position.  Write nil to indicate iteration end (see cmd/compile/internal/gc/range.go).
-       elem        unsafe.Pointer // Must be in second position (see cmd/compile/internal/gc/range.go).
+       key         unsafe.Pointer // Must be in first position.  Write nil to indicate iteration end (see cmd/compile/internal/walk/range.go).
+       elem        unsafe.Pointer // Must be in second position (see cmd/compile/internal/walk/range.go).
        t           *maptype
        h           *hmap
        buckets     unsafe.Pointer // bucket ptr at hash_iter initialization time
@@ -810,7 +810,7 @@ func mapiterinit(t *maptype, h *hmap, it *hiter) {
        }
 
        if unsafe.Sizeof(hiter{})/sys.PtrSize != 12 {
-               throw("hash_iter size incorrect") // see cmd/compile/internal/gc/reflect.go
+               throw("hash_iter size incorrect") // see cmd/compile/internal/reflectdata/reflect.go
        }
        it.t = t
        it.h = h