mirror of
https://github.com/golang/go
synced 2024-11-26 04:07:59 -07:00
runtime/map: update comment for gc/reflect
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:de65151e50
e4895ab4c0
Change-Id: Ieed5c48049ffe6889c08e164972fc7825653ac05 GitHub-Last-Rev:eec9c2328d
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>
This commit is contained in:
parent
b3064b66d0
commit
e306d06063
@ -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")
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user