github.com/shijuvar/go@v0.0.0-20141209052335-e8f13700b70c/src/reflect/export_test.go (about) 1 // Copyright 2012 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package reflect 6 7 // MakeRO returns a copy of v with the read-only flag set. 8 func MakeRO(v Value) Value { 9 v.flag |= flagRO 10 return v 11 } 12 13 // IsRO reports whether v's read-only flag is set. 14 func IsRO(v Value) bool { 15 return v.flag&flagRO != 0 16 } 17 18 var ArrayOf = arrayOf 19 var CallGC = &callGC 20 21 const PtrSize = ptrSize 22 const BitsPointer = bitsPointer 23 const BitsScalar = bitsScalar 24 25 func FuncLayout(t Type, rcvr Type) (frametype Type, argSize, retOffset uintptr, stack []byte) { 26 var ft *rtype 27 var s *bitVector 28 if rcvr != nil { 29 ft, argSize, retOffset, s = funcLayout(t.(*rtype), rcvr.(*rtype)) 30 } else { 31 ft, argSize, retOffset, s = funcLayout(t.(*rtype), nil) 32 } 33 frametype = ft 34 for i := uint32(0); i < s.n; i += 2 { 35 stack = append(stack, s.data[i/8]>>(i%8)&3) 36 } 37 return 38 }