Skip to content

Commit 6de0088

Browse files
schorsIan Lance Taylor
authored and
Ian Lance Taylor
committed
reflect: remove unused overflowPad variable
overflowPad variable in bucketOf function is a holdover from a NaCl port and never used now. Change-Id: Ib68fdb054e1b6a655ffbfd34521a3f8773a22694 GitHub-Last-Rev: f281be9 GitHub-Pull-Request: #52449 Reviewed-on: https://go-review.googlesource.com/c/go/+/401274 Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Keith Randall <[email protected]> Auto-Submit: Keith Randall <[email protected]> Reviewed-by: Keith Randall <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent 8b36445 commit 6de0088

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/reflect/type.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2244,15 +2244,14 @@ func bucketOf(ktyp, etyp *rtype) *rtype {
22442244
}
22452245

22462246
// Prepare GC data if any.
2247-
// A bucket is at most bucketSize*(1+maxKeySize+maxValSize)+2*ptrSize bytes,
2248-
// or 2072 bytes, or 259 pointer-size words, or 33 bytes of pointer bitmap.
2247+
// A bucket is at most bucketSize*(1+maxKeySize+maxValSize)+ptrSize bytes,
2248+
// or 2064 bytes, or 258 pointer-size words, or 33 bytes of pointer bitmap.
22492249
// Note that since the key and value are known to be <= 128 bytes,
22502250
// they're guaranteed to have bitmaps instead of GC programs.
22512251
var gcdata *byte
22522252
var ptrdata uintptr
2253-
var overflowPad uintptr
22542253

2255-
size := bucketSize*(1+ktyp.size+etyp.size) + overflowPad + goarch.PtrSize
2254+
size := bucketSize*(1+ktyp.size+etyp.size) + goarch.PtrSize
22562255
if size&uintptr(ktyp.align-1) != 0 || size&uintptr(etyp.align-1) != 0 {
22572256
panic("reflect: bad size computation in MapOf")
22582257
}
@@ -2271,7 +2270,6 @@ func bucketOf(ktyp, etyp *rtype) *rtype {
22712270
emitGCMask(mask, base, etyp, bucketSize)
22722271
}
22732272
base += bucketSize * etyp.size / goarch.PtrSize
2274-
base += overflowPad / goarch.PtrSize
22752273

22762274
word := base
22772275
mask[word/8] |= 1 << (word % 8)
@@ -2291,9 +2289,6 @@ func bucketOf(ktyp, etyp *rtype) *rtype {
22912289
ptrdata: ptrdata,
22922290
gcdata: gcdata,
22932291
}
2294-
if overflowPad > 0 {
2295-
b.align = 8
2296-
}
22972292
s := "bucket(" + ktyp.String() + "," + etyp.String() + ")"
22982293
b.str = resolveReflectName(newName(s, "", false))
22992294
return b

0 commit comments

Comments
 (0)