summaryrefslogtreecommitdiffhomepage
path: root/pkg/refs/refs_state_autogen.go
blob: cc788a4fdba79f86c05122d4bd0ddafd2802e8b6 (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
// automatically generated by stateify.

package refs

import (
	"gvisor.googlesource.com/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)
}

func (x *AtomicRefCount) afterLoad() {}
func (x *AtomicRefCount) load(m state.Map) {
	m.Load("refCount", &x.refCount)
}

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("refs.WeakRef", (*WeakRef)(nil), state.Fns{Save: (*WeakRef).save, Load: (*WeakRef).load})
	state.Register("refs.AtomicRefCount", (*AtomicRefCount)(nil), state.Fns{Save: (*AtomicRefCount).save, Load: (*AtomicRefCount).load})
	state.Register("refs.savedReference", (*savedReference)(nil), state.Fns{Save: (*savedReference).save, Load: (*savedReference).load})
	state.Register("refs.weakRefList", (*weakRefList)(nil), state.Fns{Save: (*weakRefList).save, Load: (*weakRefList).load})
	state.Register("refs.weakRefEntry", (*weakRefEntry)(nil), state.Fns{Save: (*weakRefEntry).save, Load: (*weakRefEntry).load})
}