]> Cypherpunks repositories - gostls13.git/commit
reflect: Remove imprecise techniques from channel/select operations.
authorKeith Randall <khr@golang.org>
Thu, 16 Jan 2014 21:35:29 +0000 (13:35 -0800)
committerKeith Randall <khr@golang.org>
Thu, 16 Jan 2014 21:35:29 +0000 (13:35 -0800)
commit873aaa59b77aaaa35612413f8144176dc1958569
treedb64f824b387ea6164b823919cfcbb4d2b8dceea
parent36477291cc13313e816cccfcfa62a6bc0ac43d15
reflect: Remove imprecise techniques from channel/select operations.

Reflect used to communicate to the runtime using interface words,
which is bad for precise GC because sometimes iwords hold a pointer
and sometimes they don't.  This change rewrites channel and select
operations to always pass pointers to the runtime.

reflect.Select gets somewhat more expensive, as we now do an allocation
per receive case instead of one allocation whose size is the max of
all the received types.  This seems unavoidable to get preciseness
(unless we move the allocation into selectgo, which is a much bigger
change).

Fixes #6490

R=golang-codereviews, dvyukov, rsc
CC=golang-codereviews
https://golang.org/cl/52900043
src/pkg/reflect/value.go
src/pkg/runtime/chan.c