aboutsummaryrefslogtreecommitdiff
path: root/src/internal/reflectlite/value.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/internal/reflectlite/value.go')
-rw-r--r--src/internal/reflectlite/value.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/internal/reflectlite/value.go b/src/internal/reflectlite/value.go
index 0365eeeabf..136273842c 100644
--- a/src/internal/reflectlite/value.go
+++ b/src/internal/reflectlite/value.go
@@ -5,13 +5,12 @@
package reflectlite
import (
+ "internal/goarch"
"internal/unsafeheader"
"runtime"
"unsafe"
)
-const ptrSize = 4 << (^uintptr(0) >> 63) // unsafe.Sizeof(uintptr(0)) but an ideal const
-
// Value is the reflection interface to a Go value.
//
// Not all methods apply to all kinds of values. Restrictions,
@@ -90,7 +89,7 @@ func (f flag) ro() flag {
// pointer returns the underlying pointer represented by v.
// v.Kind() must be Ptr, Map, Chan, Func, or UnsafePointer
func (v Value) pointer() unsafe.Pointer {
- if v.typ.size != ptrSize || !v.typ.pointers() {
+ if v.typ.size != goarch.PtrSize || !v.typ.pointers() {
panic("can't call pointer on a non-pointer Value")
}
if v.flag&flagIndir != 0 {