github.com/nicocha30/gvisor-ligolo@v0.0.0-20230726075806-989fa2c0a413/pkg/sentry/memmap/memmap_impl_state_autogen.go (about) 1 // automatically generated by stateify. 2 3 package memmap 4 5 import ( 6 "github.com/nicocha30/gvisor-ligolo/pkg/state" 7 ) 8 9 func (s *MappingSet) StateTypeName() string { 10 return "pkg/sentry/memmap.MappingSet" 11 } 12 13 func (s *MappingSet) StateFields() []string { 14 return []string{ 15 "root", 16 } 17 } 18 19 func (s *MappingSet) beforeSave() {} 20 21 // +checklocksignore 22 func (s *MappingSet) StateSave(stateSinkObject state.Sink) { 23 s.beforeSave() 24 var rootValue *MappingSegmentDataSlices 25 rootValue = s.saveRoot() 26 stateSinkObject.SaveValue(0, rootValue) 27 } 28 29 func (s *MappingSet) afterLoad() {} 30 31 // +checklocksignore 32 func (s *MappingSet) StateLoad(stateSourceObject state.Source) { 33 stateSourceObject.LoadValue(0, new(*MappingSegmentDataSlices), func(y any) { s.loadRoot(y.(*MappingSegmentDataSlices)) }) 34 } 35 36 func (n *Mappingnode) StateTypeName() string { 37 return "pkg/sentry/memmap.Mappingnode" 38 } 39 40 func (n *Mappingnode) StateFields() []string { 41 return []string{ 42 "nrSegments", 43 "parent", 44 "parentIndex", 45 "hasChildren", 46 "maxGap", 47 "keys", 48 "values", 49 "children", 50 } 51 } 52 53 func (n *Mappingnode) beforeSave() {} 54 55 // +checklocksignore 56 func (n *Mappingnode) StateSave(stateSinkObject state.Sink) { 57 n.beforeSave() 58 stateSinkObject.Save(0, &n.nrSegments) 59 stateSinkObject.Save(1, &n.parent) 60 stateSinkObject.Save(2, &n.parentIndex) 61 stateSinkObject.Save(3, &n.hasChildren) 62 stateSinkObject.Save(4, &n.maxGap) 63 stateSinkObject.Save(5, &n.keys) 64 stateSinkObject.Save(6, &n.values) 65 stateSinkObject.Save(7, &n.children) 66 } 67 68 func (n *Mappingnode) afterLoad() {} 69 70 // +checklocksignore 71 func (n *Mappingnode) StateLoad(stateSourceObject state.Source) { 72 stateSourceObject.Load(0, &n.nrSegments) 73 stateSourceObject.Load(1, &n.parent) 74 stateSourceObject.Load(2, &n.parentIndex) 75 stateSourceObject.Load(3, &n.hasChildren) 76 stateSourceObject.Load(4, &n.maxGap) 77 stateSourceObject.Load(5, &n.keys) 78 stateSourceObject.Load(6, &n.values) 79 stateSourceObject.Load(7, &n.children) 80 } 81 82 func (m *MappingSegmentDataSlices) StateTypeName() string { 83 return "pkg/sentry/memmap.MappingSegmentDataSlices" 84 } 85 86 func (m *MappingSegmentDataSlices) StateFields() []string { 87 return []string{ 88 "Start", 89 "End", 90 "Values", 91 } 92 } 93 94 func (m *MappingSegmentDataSlices) beforeSave() {} 95 96 // +checklocksignore 97 func (m *MappingSegmentDataSlices) StateSave(stateSinkObject state.Sink) { 98 m.beforeSave() 99 stateSinkObject.Save(0, &m.Start) 100 stateSinkObject.Save(1, &m.End) 101 stateSinkObject.Save(2, &m.Values) 102 } 103 104 func (m *MappingSegmentDataSlices) afterLoad() {} 105 106 // +checklocksignore 107 func (m *MappingSegmentDataSlices) StateLoad(stateSourceObject state.Source) { 108 stateSourceObject.Load(0, &m.Start) 109 stateSourceObject.Load(1, &m.End) 110 stateSourceObject.Load(2, &m.Values) 111 } 112 113 func init() { 114 state.Register((*MappingSet)(nil)) 115 state.Register((*Mappingnode)(nil)) 116 state.Register((*MappingSegmentDataSlices)(nil)) 117 }