Re: [go-nuts] Re: memclr optimization and structs

2017-04-17 Thread 'Keith Randall' via golang-nuts
Sorry, my first look at this was incorrect. Changing the pointer to a scalar does re-enable the optimization. But so does making it less than 4 words in size. The optimization fails because the loop body gets translated to { tmp := Foo{}; testFoo[i] = tmp } by the order pass (cmd/compile/int

Re: [go-nuts] Re: memclr optimization and structs

2017-04-16 Thread T L
On Saturday, April 15, 2017 at 7:18:51 PM UTC+8, Konstantin Khomoutov wrote: > > On Sat, 15 Apr 2017 01:31:27 -0700 (PDT) > "'Keith Randall' via golang-nuts" > > wrote: > > > > I've been looking into why some of our code wasn't resulting in the > > > memclr optimization originally introduced

Re: [go-nuts] Re: memclr optimization and structs

2017-04-15 Thread Konstantin Khomoutov
On Sat, 15 Apr 2017 01:31:27 -0700 (PDT) "'Keith Randall' via golang-nuts" wrote: > > I've been looking into why some of our code wasn't resulting in the > > memclr optimization originally introduced in response to > > https://github.com/golang/go/issues/5373. [...] > > type Foo struct { > >

[go-nuts] Re: memclr optimization and structs

2017-04-15 Thread 'Keith Randall' via golang-nuts
The value being zeroed must not have any pointers. This is a change from 1.7 and is part of the requirement for the hybrid write barrier (part of making garbage collection pauses smaller). On Friday, April 14, 2017 at 4:02:24