summaryrefslogtreecommitdiff
path: root/vendor/github.com/bytedance/sonic/internal/rt/fastvalue.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/bytedance/sonic/internal/rt/fastvalue.go')
-rw-r--r--vendor/github.com/bytedance/sonic/internal/rt/fastvalue.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/vendor/github.com/bytedance/sonic/internal/rt/fastvalue.go b/vendor/github.com/bytedance/sonic/internal/rt/fastvalue.go
index 87df6b94a..2b2757f5b 100644
--- a/vendor/github.com/bytedance/sonic/internal/rt/fastvalue.go
+++ b/vendor/github.com/bytedance/sonic/internal/rt/fastvalue.go
@@ -22,14 +22,23 @@ import (
)
var (
- reflectRtypeItab = findReflectRtypeItab()
+ reflectRtypeItab = findReflectRtypeItab()
)
+// GoType.KindFlags const
const (
F_direct = 1 << 5
F_kind_mask = (1 << 5) - 1
)
+// GoType.Flags const
+const (
+ tflagUncommon uint8 = 1 << 0
+ tflagExtraStar uint8 = 1 << 1
+ tflagNamed uint8 = 1 << 2
+ tflagRegularMemory uint8 = 1 << 3
+)
+
type GoType struct {
Size uintptr
PtrData uintptr
@@ -44,6 +53,10 @@ type GoType struct {
PtrToSelf int32
}
+func (self *GoType) IsNamed() bool {
+ return (self.Flags & tflagNamed) != 0
+}
+
func (self *GoType) Kind() reflect.Kind {
return reflect.Kind(self.KindFlags & F_kind_mask)
}