1
0
mirror of https://github.com/golang/go synced 2024-11-25 01:57:56 -07:00

reflect: use []unsafe.Pointer instead of []*int

R=rsc
CC=golang-dev
https://golang.org/cl/6527043
This commit is contained in:
Jan Ziak 2012-09-18 14:23:11 -04:00 committed by Russ Cox
parent ccf2b8843e
commit 384af66984

View File

@ -490,9 +490,9 @@ func (v Value) call(method string, in []Value) []Value {
// TODO(rsc): revisit when reference counting happens. // TODO(rsc): revisit when reference counting happens.
// The values are holding up the in references for us, // The values are holding up the in references for us,
// but something must be done for the out references. // but something must be done for the out references.
// For now make everything look like a pointer by pretending // For now make everything look like a pointer by allocating
// to allocate a []*int. // a []unsafe.Pointer.
args := make([]*int, size/ptrSize) args := make([]unsafe.Pointer, size/ptrSize)
ptr := uintptr(unsafe.Pointer(&args[0])) ptr := uintptr(unsafe.Pointer(&args[0]))
off := uintptr(0) off := uintptr(0)
if v.flag&flagMethod != 0 { if v.flag&flagMethod != 0 {