package p
type T struct {
a *[10]int
b [10]int
}
func (t *T) resetA() {
for i := range t.a {
t.a[i] = 0
}
}
func (t *T) resetB() {
for i := range t.b {
t.b[i] = 0
}
}
resetA compiles to a loop. resetB compiles to a call to runtime.memclrNoHeapPointers. I believe that resetA should also call memclrNoHeapPointers.
This showed up as a hot spot in my code today (with much larger arrays).
cc @randall77 @cuonglm @mdempsky
resetA compiles to a loop. resetB compiles to a call to runtime.memclrNoHeapPointers. I believe that resetA should also call memclrNoHeapPointers.
This showed up as a hot spot in my code today (with much larger arrays).
cc @randall77 @cuonglm @mdempsky