MCPcopy
hub / github.com/gopherjs/gopherjs / Pointer

Method Pointer

compiler/natives/src/reflect/reflect.go:1295–1315  ·  view source on GitHub ↗

gopherjs:replace

()

Source from the content-addressed store, hash-verified

1293
1294//gopherjs:replace
1295func (v Value) Pointer() uintptr {
1296 switch k := v.kind(); k {
1297 case Chan, Map, Ptr, UnsafePointer:
1298 if v.IsNil() {
1299 return 0
1300 }
1301 return v.object().Unsafe()
1302 case Func:
1303 if v.IsNil() {
1304 return 0
1305 }
1306 return 1
1307 case Slice:
1308 if v.IsNil() {
1309 return 0
1310 }
1311 return v.object().Get("$array").Unsafe()
1312 default:
1313 panic(&ValueError{"reflect.Value.Pointer", k})
1314 }
1315}
1316
1317//gopherjs:replace
1318func (v Value) Set(x Value) {

Callers 15

UnsafePointerMethod · 0.95
toRTypeFunction · 0.80
makeValueFunction · 0.80
StructOfFunction · 0.80
MakeFuncFunction · 0.80
makechanFunction · 0.80
makemapFunction · 0.80
mapaccessFunction · 0.80
mapaccess_faststrFunction · 0.80
mapassign_faststrFunction · 0.80
mapdelete_faststrFunction · 0.80
mapiterkeyFunction · 0.80

Calls 4

IsNilMethod · 0.95
objectMethod · 0.95
UnsafeMethod · 0.80
GetMethod · 0.65

Tested by 1

FieldMethod · 0.64