github.com/MerlinKodo/gvisor@v0.0.0-20231110090155-957f62ecf90e/pkg/sentry/limits/limits_state_autogen.go (about) 1 // automatically generated by stateify. 2 3 package limits 4 5 import ( 6 "github.com/MerlinKodo/gvisor/pkg/state" 7 ) 8 9 func (l *Limit) StateTypeName() string { 10 return "pkg/sentry/limits.Limit" 11 } 12 13 func (l *Limit) StateFields() []string { 14 return []string{ 15 "Cur", 16 "Max", 17 } 18 } 19 20 func (l *Limit) beforeSave() {} 21 22 // +checklocksignore 23 func (l *Limit) StateSave(stateSinkObject state.Sink) { 24 l.beforeSave() 25 stateSinkObject.Save(0, &l.Cur) 26 stateSinkObject.Save(1, &l.Max) 27 } 28 29 func (l *Limit) afterLoad() {} 30 31 // +checklocksignore 32 func (l *Limit) StateLoad(stateSourceObject state.Source) { 33 stateSourceObject.Load(0, &l.Cur) 34 stateSourceObject.Load(1, &l.Max) 35 } 36 37 func (l *LimitSet) StateTypeName() string { 38 return "pkg/sentry/limits.LimitSet" 39 } 40 41 func (l *LimitSet) StateFields() []string { 42 return []string{ 43 "data", 44 } 45 } 46 47 func (l *LimitSet) beforeSave() {} 48 49 // +checklocksignore 50 func (l *LimitSet) StateSave(stateSinkObject state.Sink) { 51 l.beforeSave() 52 stateSinkObject.Save(0, &l.data) 53 } 54 55 func (l *LimitSet) afterLoad() {} 56 57 // +checklocksignore 58 func (l *LimitSet) StateLoad(stateSourceObject state.Source) { 59 stateSourceObject.Load(0, &l.data) 60 } 61 62 func init() { 63 state.Register((*Limit)(nil)) 64 state.Register((*LimitSet)(nil)) 65 }