]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal/ir: correct doc comment, miniNode in now 12 bytes
authorMateusz Poliwczak <mpoliwczak34@gmail.com>
Wed, 19 Feb 2025 07:15:19 +0000 (07:15 +0000)
committerGopher Robot <gobot@golang.org>
Wed, 19 Feb 2025 21:39:02 +0000 (13:39 -0800)
Change-Id: I5887565077f598bc7e3edc4b78188956fb13cdaa
GitHub-Last-Rev: 479a04b42e9dc2ffc72cb599ebb12b8fc669fe20
GitHub-Pull-Request: golang/go#71822
Reviewed-on: https://go-review.googlesource.com/c/go/+/650415
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
src/cmd/compile/internal/ir/mini.go
src/cmd/compile/internal/ir/sizeof_test.go

index 52c622df2306e6f29f46bdf650fc98f25abf8fe5..70897fc3f9c8ded156ff57903182c3747842c52b 100644 (file)
@@ -15,7 +15,7 @@ import (
 
 // A miniNode is a minimal node implementation,
 // meant to be embedded as the first field in a larger node implementation,
-// at a cost of 8 bytes.
+// at a cost of 12 bytes.
 //
 // A miniNode is NOT a valid Node by itself: the embedding struct
 // must at the least provide:
@@ -28,8 +28,8 @@ import (
 // for more useful panic messages when invalid methods are called,
 // instead of implementing Op itself.
 type miniNode struct {
-       pos  src.XPos // uint32
-       op   Op       // uint8
+       pos  src.XPos
+       op   Op
        bits bitset8
        esc  uint16
 }
index 1715bad0c147b845467d03b9ed397c3fbefa0894..14b6b4f3cd475053f03730011286bf559953846d 100644 (file)
@@ -23,6 +23,7 @@ func TestSizeof(t *testing.T) {
                {Func{}, 184, 312},
                {Name{}, 96, 160},
                {miniExpr{}, 32, 48},
+               {miniNode{}, 12, 12},
        }
 
        for _, tt := range tests {