]> Cypherpunks repositories - gostls13.git/commit
make every func literal expression allocate,
authorRuss Cox <rsc@golang.org>
Wed, 29 Jul 2009 03:01:00 +0000 (20:01 -0700)
committerRuss Cox <rsc@golang.org>
Wed, 29 Jul 2009 03:01:00 +0000 (20:01 -0700)
commit9346c6d901b3714b2a39967d6f0fee5b82201c78
tree8a67b2efe49f8ab0283f63357abc34358617d955
parent83940d7c4a2a7ddf5c485f2745573552b096775c
make every func literal expression allocate,
so that == on func means that the
functions originated in the same
execution of a func literal or definition.

before, there was an inconsistency:

func() {x++} != func() {x++}

but

func() {} == func() {}

this CL makes the second case != too,
just like

make(map[int]int) != make(map[int]int)

R=r
DELTA=202  (71 added, 62 deleted, 69 changed)
OCL=32393
CL=32398
src/cmd/gc/dcl.c
src/pkg/runtime/386/closure.c
src/pkg/runtime/amd64/closure.c
test/closure.go