summaryrefslogtreecommitdiffhomepage
path: root/pkg/refs/refs_state_autogen.go
blob: 53e06c283c14b562662f447d4714cbd0aa5473d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
// automatically generated by stateify.

package refs

import (
	"gvisor.dev/gvisor/pkg/state"
)

func (x *WeakRef) StateTypeName() string {
	return "pkg/refs.WeakRef"
}

func (x *WeakRef) StateFields() []string {
	return []string{
		"obj",
		"user",
	}
}

func (x *WeakRef) beforeSave() {}

func (x *WeakRef) StateSave(m state.Sink) {
	x.beforeSave()
	var obj savedReference = x.saveObj()
	m.SaveValue(0, obj)
	m.Save(1, &x.user)
}

func (x *WeakRef) afterLoad() {}

func (x *WeakRef) StateLoad(m state.Source) {
	m.Load(1, &x.user)
	m.LoadValue(0, new(savedReference), func(y interface{}) { x.loadObj(y.(savedReference)) })
}

func (x *AtomicRefCount) StateTypeName() string {
	return "pkg/refs.AtomicRefCount"
}

func (x *AtomicRefCount) StateFields() []string {
	return []string{
		"refCount",
		"name",
		"stack",
	}
}

func (x *AtomicRefCount) beforeSave() {}

func (x *AtomicRefCount) StateSave(m state.Sink) {
	x.beforeSave()
	m.Save(0, &x.refCount)
	m.Save(1, &x.name)
	m.Save(2, &x.stack)
}

func (x *AtomicRefCount) afterLoad() {}

func (x *AtomicRefCount) StateLoad(m state.Source) {
	m.Load(0, &x.refCount)
	m.Load(1, &x.name)
	m.Load(2, &x.stack)
}

func (x *savedReference) StateTypeName() string {
	return "pkg/refs.savedReference"
}

func (x *savedReference) StateFields() []string {
	return []string{
		"obj",
	}
}

func (x *savedReference) beforeSave() {}

func (x *savedReference) StateSave(m state.Sink) {
	x.beforeSave()
	m.Save(0, &x.obj)
}

func (x *savedReference) afterLoad() {}

func (x *savedReference) StateLoad(m state.Source) {
	m.Load(0, &x.obj)
}

func (x *weakRefList) StateTypeName() string {
	return "pkg/refs.weakRefList"
}

func (x *weakRefList) StateFields() []string {
	return []string{
		"head",
		"tail",
	}
}

func (x *weakRefList) beforeSave() {}

func (x *weakRefList) StateSave(m state.Sink) {
	x.beforeSave()
	m.Save(0, &x.head)
	m.Save(1, &x.tail)
}

func (x *weakRefList) afterLoad() {}

func (x *weakRefList) StateLoad(m state.Source) {
	m.Load(0, &x.head)
	m.Load(1, &x.tail)
}

func (x *weakRefEntry) StateTypeName() string {
	return "pkg/refs.weakRefEntry"
}

func (x *weakRefEntry) StateFields() []string {
	return []string{
		"next",
		"prev",
	}
}

func (x *weakRefEntry) beforeSave() {}

func (x *weakRefEntry) StateSave(m state.Sink) {
	x.beforeSave()
	m.Save(0, &x.next)
	m.Save(1, &x.prev)
}

func (x *weakRefEntry) afterLoad() {}

func (x *weakRefEntry) StateLoad(m state.Source) {
	m.Load(0, &x.next)
	m.Load(1, &x.prev)
}

func init() {
	state.Register((*WeakRef)(nil))
	state.Register((*AtomicRefCount)(nil))
	state.Register((*savedReference)(nil))
	state.Register((*weakRefList)(nil))
	state.Register((*weakRefEntry)(nil))
}