From 08c8a26e9ca87ad2dd5b26d397e6107b68adfe76 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 3 May 2019 21:45:35 +0000 Subject: compiler: recognize and optimize array range clear Recognize for i := range a { a[i] = zero } for array or slice a, and rewrite it to call memclr, as the gc compiler does. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/169398 From-SVN: r270862 --- libgo/go/runtime/mbarrier.go | 1 + 1 file changed, 1 insertion(+) (limited to 'libgo') diff --git a/libgo/go/runtime/mbarrier.go b/libgo/go/runtime/mbarrier.go index d3ffd3c..89febb9 100644 --- a/libgo/go/runtime/mbarrier.go +++ b/libgo/go/runtime/mbarrier.go @@ -23,6 +23,7 @@ import ( // //go:linkname typedmemmove runtime.typedmemmove //go:linkname typedslicecopy runtime.typedslicecopy +//go:linkname memclrHasPointers runtime.memclrHasPointers // Go uses a hybrid barrier that combines a Yuasa-style deletion // barrier—which shades the object whose reference is being -- cgit v1.1