Skip to content

Commit f37d754

Browse files
committed
runtime: move mksizeclasses.go to runtime/_mkmalloc
This will allow us to share code with the specialized malloc code generator. Change-Id: I6a6a696450a5039a957811fb06228122d494ddce Reviewed-on: https://go-review.googlesource.com/c/go/+/700495 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Michael Knyszek <[email protected]> Reviewed-by: Michael Matloob <[email protected]>
1 parent 73676e3 commit f37d754

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/internal/runtime/gc/sizeclasses.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/internal/runtime/gc/mksizeclasses.go renamed to src/runtime/_mkmalloc/mksizeclasses.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
//go:build ignore
6-
75
// Generate tables for small malloc size classes.
86
//
97
// See malloc.go for overview.
@@ -41,7 +39,7 @@ import (
4139
"os"
4240
)
4341

44-
// Generate msize.go
42+
// Generate internal/runtime/gc/msize.go
4543

4644
var stdout = flag.Bool("stdout", false, "write to stdout instead of sizeclasses.go")
4745

@@ -50,7 +48,7 @@ func main() {
5048

5149
var b bytes.Buffer
5250
fmt.Fprintln(&b, "// Code generated by mksizeclasses.go; DO NOT EDIT.")
53-
fmt.Fprintln(&b, "//go:generate go run mksizeclasses.go")
51+
fmt.Fprintln(&b, "//go:generate go -C ../../../runtime/_mkmalloc run mksizeclasses.go")
5452
fmt.Fprintln(&b)
5553
fmt.Fprintln(&b, "package gc")
5654
classes := makeClasses()
@@ -66,7 +64,7 @@ func main() {
6664
if *stdout {
6765
_, err = os.Stdout.Write(out)
6866
} else {
69-
err = os.WriteFile("sizeclasses.go", out, 0666)
67+
err = os.WriteFile("../../internal/runtime/gc/sizeclasses.go", out, 0666)
7068
}
7169
if err != nil {
7270
log.Fatal(err)

0 commit comments

Comments
 (0)