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
|
// automatically generated by stateify.
package refs
import (
"gvisor.dev/gvisor/pkg/state"
)
func (x *WeakRef) beforeSave() {}
func (x *WeakRef) save(m state.Map) {
x.beforeSave()
var obj savedReference = x.saveObj()
m.SaveValue("obj", obj)
m.Save("user", &x.user)
}
func (x *WeakRef) afterLoad() {}
func (x *WeakRef) load(m state.Map) {
m.Load("user", &x.user)
m.LoadValue("obj", new(savedReference), func(y interface{}) { x.loadObj(y.(savedReference)) })
}
func (x *AtomicRefCount) beforeSave() {}
func (x *AtomicRefCount) save(m state.Map) {
x.beforeSave()
m.Save("refCount", &x.refCount)
m.Save("name", &x.name)
m.Save("stack", &x.stack)
}
func (x *AtomicRefCount) afterLoad() {}
func (x *AtomicRefCount) load(m state.Map) {
m.Load("refCount", &x.refCount)
m.Load("name", &x.name)
m.Load("stack", &x.stack)
}
func (x *savedReference) beforeSave() {}
func (x *savedReference) save(m state.Map) {
x.beforeSave()
m.Save("obj", &x.obj)
}
func (x *savedReference) afterLoad() {}
func (x *savedReference) load(m state.Map) {
m.Load("obj", &x.obj)
}
func (x *weakRefList) beforeSave() {}
func (x *weakRefList) save(m state.Map) {
x.beforeSave()
m.Save("head", &x.head)
m.Save("tail", &x.tail)
}
func (x *weakRefList) afterLoad() {}
func (x *weakRefList) load(m state.Map) {
m.Load("head", &x.head)
m.Load("tail", &x.tail)
}
func (x *weakRefEntry) beforeSave() {}
func (x *weakRefEntry) save(m state.Map) {
x.beforeSave()
m.Save("next", &x.next)
m.Save("prev", &x.prev)
}
func (x *weakRefEntry) afterLoad() {}
func (x *weakRefEntry) load(m state.Map) {
m.Load("next", &x.next)
m.Load("prev", &x.prev)
}
func init() {
state.Register("pkg/refs.WeakRef", (*WeakRef)(nil), state.Fns{Save: (*WeakRef).save, Load: (*WeakRef).load})
state.Register("pkg/refs.AtomicRefCount", (*AtomicRefCount)(nil), state.Fns{Save: (*AtomicRefCount).save, Load: (*AtomicRefCount).load})
state.Register("pkg/refs.savedReference", (*savedReference)(nil), state.Fns{Save: (*savedReference).save, Load: (*savedReference).load})
state.Register("pkg/refs.weakRefList", (*weakRefList)(nil), state.Fns{Save: (*weakRefList).save, Load: (*weakRefList).load})
state.Register("pkg/refs.weakRefEntry", (*weakRefEntry)(nil), state.Fns{Save: (*weakRefEntry).save, Load: (*weakRefEntry).load})
}
|