x doesn't escape, the result of evaluating *x passed to Println escapes because
escape analysis cannot determine if the contents of the ...interface{} passed
to fmt.Println are retained. It's a very hard case for escape ananlysis.
--
You received this message because you are subscribed to the
On Wednesday, March 22, 2017 at 7:49:39 PM UTC+8, Dave Cheney wrote:
>
> Well, that program isn't that simple because of the closure, but also
> because it contains a data race
>
> Something like this is easier to reason about
>
> var x *int
>
> func main() {
> var a int
> x = &a
It isn't just inlining that affects closures.
Most programming languages with closures use several closure
representations at the same time. The compiler picks among them depending
on which representation gives the best program efficiency at runtime and
depending on what information they staticall
On Wednesday, March 22, 2017 at 10:38:32 PM UTC+8, T L wrote:
>
>
>
> On Wednesday, March 22, 2017 at 7:49:39 PM UTC+8, Dave Cheney wrote:
>>
>> Well, that program isn't that simple because of the closure, but also
>> because it contains a data race
>>
>> Something like this is easier to reason
On Wednesday, March 22, 2017 at 7:49:39 PM UTC+8, Dave Cheney wrote:
>
> Well, that program isn't that simple because of the closure, but also
> because it contains a data race
>
> Something like this is easier to reason about
>
> var x *int
>
> func main() {
> var a int
> x = &a
On Wednesday, March 22, 2017 at 9:29:32 PM UTC+8, Ian Lance Taylor wrote:
>
> On Wed, Mar 22, 2017 at 3:59 AM, T L >
> wrote:
> >
> > On Wednesday, March 22, 2017 at 6:40:53 PM UTC+8, Jesse McNelis wrote:
> >>
> >> On Wed, Mar 22, 2017 at 8:51 PM, T L wrote:
> >> >
> >> > More accurately
On Wed, Mar 22, 2017 at 3:59 AM, T L wrote:
>
> On Wednesday, March 22, 2017 at 6:40:53 PM UTC+8, Jesse McNelis wrote:
>>
>> On Wed, Mar 22, 2017 at 8:51 PM, T L wrote:
>> >
>> > More accurately, I think it should be: from the POV of a programmer,
>> > it's
>> > globals, and things reachable fro
Well, that program isn't that simple because of the closure, but also
because it contains a data race
Something like this is easier to reason about
var x *int
func main() {
var a int
x = &a
fmt.Println(*x)
}
On Wednesday, 22 March 2017 21:59:17 UTC+11, T L wrote:
>
>
>
On Wednesday, March 22, 2017 at 6:40:53 PM UTC+8, Jesse McNelis wrote:
>
> On Wed, Mar 22, 2017 at 8:51 PM, T L >
> wrote:
> >
> > More accurately, I think it should be: from the POV of a programmer,
> it's
> > globals, and things reachable from each goroutine.
> >
>
> The only way to rea
On Wednesday, March 22, 2017 at 6:40:53 PM UTC+8, Jesse McNelis wrote:
>
> On Wed, Mar 22, 2017 at 8:51 PM, T L >
> wrote:
> >
> > More accurately, I think it should be: from the POV of a programmer,
> it's
> > globals, and things reachable from each goroutine.
> >
>
> The only way to rea
On Wed, Mar 22, 2017 at 8:51 PM, T L wrote:
>
> More accurately, I think it should be: from the POV of a programmer, it's
> globals, and things reachable from each goroutine.
>
The only way to reach a value is through a variable in scope and the
only variables in scope are global or on the stack
On Wednesday, March 22, 2017 at 6:00:12 PM UTC+8, Dave Cheney wrote:
>
>
>
> On Wednesday, 22 March 2017 20:51:18 UTC+11, T L wrote:
>>
>>
>>
>> On Wednesday, March 22, 2017 at 4:56:28 PM UTC+8, Dave Cheney wrote:
>>>
>>> The comment on
>>>
>>> https://github.com/golang/go/blob/master/src/runtim
On Wednesday, 22 March 2017 20:51:18 UTC+11, T L wrote:
>
>
>
> On Wednesday, March 22, 2017 at 4:56:28 PM UTC+8, Dave Cheney wrote:
>>
>> The comment on
>>
>> https://github.com/golang/go/blob/master/src/runtime/mgc.go#L47
>>
>> //c. GC performs root marking jobs. This includes scanning all
On Wednesday, March 22, 2017 at 4:56:28 PM UTC+8, Dave Cheney wrote:
>
> The comment on
>
> https://github.com/golang/go/blob/master/src/runtime/mgc.go#L47
>
> //c. GC performs root marking jobs. This includes scanning all
> //stacks, shading all globals, and shading any heap pointers in
The comment on
https://github.com/golang/go/blob/master/src/runtime/mgc.go#L47
//c. GC performs root marking jobs. This includes scanning all
//stacks, shading all globals, and shading any heap pointers in
//off-heap runtime data structures. Scanning a stack stops a
//goroutine,
On Wednesday, March 22, 2017 at 4:33:21 PM UTC+8, Dave Cheney wrote:
>
>
>
> On Wednesday, 22 March 2017 19:29:02 UTC+11, T L wrote:
>>
>>
>>
>> On Wednesday, March 22, 2017 at 4:08:02 PM UTC+8, Dave Cheney wrote:
>>>
>>>
>>>
>>> On Wednesday, 22 March 2017 19:04:36 UTC+11, T L wrote:
I
On Wednesday, 22 March 2017 19:29:02 UTC+11, T L wrote:
>
>
>
> On Wednesday, March 22, 2017 at 4:08:02 PM UTC+8, Dave Cheney wrote:
>>
>>
>>
>> On Wednesday, 22 March 2017 19:04:36 UTC+11, T L wrote:
>>>
>>> In this article: https://blog.golang.org/go15gc , it mentions
>>>
>>> ..., The GC visits
On Wednesday, March 22, 2017 at 4:08:02 PM UTC+8, Dave Cheney wrote:
>
>
>
> On Wednesday, 22 March 2017 19:04:36 UTC+11, T L wrote:
>>
>> In this article: https://blog.golang.org/go15gc , it mentions
>>
>> ..., The GC visits all *roots*, which are objects directly accessible by
>>> the applicat
On Wednesday, 22 March 2017 19:04:36 UTC+11, T L wrote:
>
> In this article: https://blog.golang.org/go15gc , it mentions
>
> ..., The GC visits all *roots*, which are objects directly accessible by
>> the application such as globals and things on the stack, and colors these
>> grey. ...
>
>
>
19 matches
Mail list logo