diff options
| author | thepudds <thepudds1460@gmail.com> | 2025-11-09 09:24:22 -0500 |
|---|---|---|
| committer | t hepudds <thepudds1460@gmail.com> | 2025-11-14 14:23:16 -0800 |
| commit | 50128a21541e3fd712ad717a223aaa109cb86d43 (patch) | |
| tree | 984e45288bdebd7dd2533a8ab62c4154cec244cf /src/runtime/_mkmalloc/mkmalloc.go | |
| parent | c3708350a417a3149bf9191878c3ad945063d439 (diff) | |
| download | go-50128a21541e3fd712ad717a223aaa109cb86d43.tar.xz | |
runtime: support runtime.freegc in size-specialized mallocs for noscan objects
This CL is part of a set of CLs that attempt to reduce how much work the
GC must do. See the design in https://go.dev/design/74299-runtime-freegc
This CL updates the smallNoScanStub stub in malloc_stubs.go to reuse
heap objects that have been freed by runtime.freegc calls, and generates
the corresponding size-specialized code in malloc_generated.go.
This CL only adds support in the specialized mallocs for noscan
heap objects (objects without pointers). A later CL handles objects
with pointers.
While we are here, we leave a couple of breadcrumbs in mkmalloc.go on
how to do the generation.
Updates #74299
Change-Id: I2657622601a27211554ee862fce057e101767a70
Reviewed-on: https://go-review.googlesource.com/c/go/+/715761
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Diffstat (limited to 'src/runtime/_mkmalloc/mkmalloc.go')
| -rw-r--r-- | src/runtime/_mkmalloc/mkmalloc.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/runtime/_mkmalloc/mkmalloc.go b/src/runtime/_mkmalloc/mkmalloc.go index 986b0aa9f8..1f040c8861 100644 --- a/src/runtime/_mkmalloc/mkmalloc.go +++ b/src/runtime/_mkmalloc/mkmalloc.go @@ -254,7 +254,8 @@ func inline(config generatorConfig) []byte { } // Write out the package and import declarations. - out.WriteString("// Code generated by mkmalloc.go; DO NOT EDIT.\n\n") + out.WriteString("// Code generated by mkmalloc.go; DO NOT EDIT.\n") + out.WriteString("// See overview in malloc_stubs.go.\n\n") out.WriteString("package " + f.Name.Name + "\n\n") for _, importDecl := range importDecls { out.Write(mustFormatNode(fset, importDecl)) |
