]> Cypherpunks repositories - gostls13.git/commitdiff
reflect: remove unused overflowPad variable
authorPhil Kulin <schors@gmail.com>
Wed, 20 Apr 2022 14:13:29 +0000 (14:13 +0000)
committerIan Lance Taylor <iant@google.com>
Wed, 20 Apr 2022 22:49:26 +0000 (22:49 +0000)
overflowPad variable in bucketOf function is a holdover from a NaCl port
and never used now.

Change-Id: Ib68fdb054e1b6a655ffbfd34521a3f8773a22694
GitHub-Last-Rev: f281be9c115a87605fd28b39c0b09eed54cc774a
GitHub-Pull-Request: golang/go#52449
Reviewed-on: https://go-review.googlesource.com/c/go/+/401274
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
src/reflect/type.go

index e8882664750c5121e4e13b1a03867582c1d279ab..97040b51887bd4f7b0b944e61f9be0c111ab29ac 100644 (file)
@@ -2244,15 +2244,14 @@ func bucketOf(ktyp, etyp *rtype) *rtype {
        }
 
        // Prepare GC data if any.
-       // A bucket is at most bucketSize*(1+maxKeySize+maxValSize)+2*ptrSize bytes,
-       // or 2072 bytes, or 259 pointer-size words, or 33 bytes of pointer bitmap.
+       // A bucket is at most bucketSize*(1+maxKeySize+maxValSize)+ptrSize bytes,
+       // or 2064 bytes, or 258 pointer-size words, or 33 bytes of pointer bitmap.
        // Note that since the key and value are known to be <= 128 bytes,
        // they're guaranteed to have bitmaps instead of GC programs.
        var gcdata *byte
        var ptrdata uintptr
-       var overflowPad uintptr
 
-       size := bucketSize*(1+ktyp.size+etyp.size) + overflowPad + goarch.PtrSize
+       size := bucketSize*(1+ktyp.size+etyp.size) + goarch.PtrSize
        if size&uintptr(ktyp.align-1) != 0 || size&uintptr(etyp.align-1) != 0 {
                panic("reflect: bad size computation in MapOf")
        }
@@ -2271,7 +2270,6 @@ func bucketOf(ktyp, etyp *rtype) *rtype {
                        emitGCMask(mask, base, etyp, bucketSize)
                }
                base += bucketSize * etyp.size / goarch.PtrSize
-               base += overflowPad / goarch.PtrSize
 
                word := base
                mask[word/8] |= 1 << (word % 8)
@@ -2291,9 +2289,6 @@ func bucketOf(ktyp, etyp *rtype) *rtype {
                ptrdata: ptrdata,
                gcdata:  gcdata,
        }
-       if overflowPad > 0 {
-               b.align = 8
-       }
        s := "bucket(" + ktyp.String() + "," + etyp.String() + ")"
        b.str = resolveReflectName(newName(s, "", false))
        return b