]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: compute ptrBytes during CalcSize instead of on demand
authorKeith Randall <khr@golang.org>
Fri, 15 Mar 2024 21:30:34 +0000 (14:30 -0700)
committerKeith Randall <khr@golang.org>
Mon, 18 Mar 2024 17:08:44 +0000 (17:08 +0000)
commitb40dc30d24afe877f4b7d80c69b827765531cdc7
tree86f3c2200dfc54020c71edd962fabbec4aae13e5
parentdda4b17ee4866a32a7d0b522f9a366cb6d687ce1
cmd/compile: compute ptrBytes during CalcSize instead of on demand

Compute ptrBytes while computing the size of a type.
Requires an extra field on the type, but means that we don't
have potentially exponential behavior in the PtrDataSize computation.

For #65540.

Change-Id: Ia23c72bbd996730baddd32d9ed46cfc00c3472ee
Reviewed-on: https://go-review.googlesource.com/c/go/+/571543
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/types/size.go
src/cmd/compile/internal/types/sizeof_test.go
src/cmd/compile/internal/types/type.go