mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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 <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Michael Matloob <matloob@google.com>
This commit is contained in:
parent
73676e3223
commit
f37d75472d
2 changed files with 4 additions and 6 deletions
|
|
@ -1,5 +1,5 @@
|
|||
// Code generated by mksizeclasses.go; DO NOT EDIT.
|
||||
//go:generate go run mksizeclasses.go
|
||||
//go:generate go -C ../../../runtime/_mkmalloc run mksizeclasses.go
|
||||
|
||||
package gc
|
||||
|
||||
|
|
|
|||
|
|
@ -2,8 +2,6 @@
|
|||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build ignore
|
||||
|
||||
// Generate tables for small malloc size classes.
|
||||
//
|
||||
// See malloc.go for overview.
|
||||
|
|
@ -41,7 +39,7 @@ import (
|
|||
"os"
|
||||
)
|
||||
|
||||
// Generate msize.go
|
||||
// Generate internal/runtime/gc/msize.go
|
||||
|
||||
var stdout = flag.Bool("stdout", false, "write to stdout instead of sizeclasses.go")
|
||||
|
||||
|
|
@ -50,7 +48,7 @@ func main() {
|
|||
|
||||
var b bytes.Buffer
|
||||
fmt.Fprintln(&b, "// Code generated by mksizeclasses.go; DO NOT EDIT.")
|
||||
fmt.Fprintln(&b, "//go:generate go run mksizeclasses.go")
|
||||
fmt.Fprintln(&b, "//go:generate go -C ../../../runtime/_mkmalloc run mksizeclasses.go")
|
||||
fmt.Fprintln(&b)
|
||||
fmt.Fprintln(&b, "package gc")
|
||||
classes := makeClasses()
|
||||
|
|
@ -66,7 +64,7 @@ func main() {
|
|||
if *stdout {
|
||||
_, err = os.Stdout.Write(out)
|
||||
} else {
|
||||
err = os.WriteFile("sizeclasses.go", out, 0666)
|
||||
err = os.WriteFile("../../internal/runtime/gc/sizeclasses.go", out, 0666)
|
||||
}
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
Loading…
Add table
Add a link
Reference in a new issue