github.com/sagernet/gvisor@v0.0.0-20240428053021-e691de28565f/pkg/bitmap/bitmap_state_autogen.go (about) 1 // automatically generated by stateify. 2 3 package bitmap 4 5 import ( 6 "context" 7 8 "github.com/sagernet/gvisor/pkg/state" 9 ) 10 11 func (b *Bitmap) StateTypeName() string { 12 return "pkg/bitmap.Bitmap" 13 } 14 15 func (b *Bitmap) StateFields() []string { 16 return []string{ 17 "numOnes", 18 "bitBlock", 19 } 20 } 21 22 func (b *Bitmap) beforeSave() {} 23 24 // +checklocksignore 25 func (b *Bitmap) StateSave(stateSinkObject state.Sink) { 26 b.beforeSave() 27 stateSinkObject.Save(0, &b.numOnes) 28 stateSinkObject.Save(1, &b.bitBlock) 29 } 30 31 func (b *Bitmap) afterLoad(context.Context) {} 32 33 // +checklocksignore 34 func (b *Bitmap) StateLoad(ctx context.Context, stateSourceObject state.Source) { 35 stateSourceObject.Load(0, &b.numOnes) 36 stateSourceObject.Load(1, &b.bitBlock) 37 } 38 39 func init() { 40 state.Register((*Bitmap)(nil)) 41 }