github.com/metacubex/gvisor@v0.0.0-20240320004321-933faba989ec/pkg/sentry/kernel/futex/futex_unsafe_state_autogen.go (about)

     1  // automatically generated by stateify.
     2  
     3  package futex
     4  
     5  import (
     6  	"context"
     7  
     8  	"github.com/metacubex/gvisor/pkg/state"
     9  )
    10  
    11  func (p *AtomicPtrBucket) StateTypeName() string {
    12  	return "pkg/sentry/kernel/futex.AtomicPtrBucket"
    13  }
    14  
    15  func (p *AtomicPtrBucket) StateFields() []string {
    16  	return []string{
    17  		"ptr",
    18  	}
    19  }
    20  
    21  func (p *AtomicPtrBucket) beforeSave() {}
    22  
    23  // +checklocksignore
    24  func (p *AtomicPtrBucket) StateSave(stateSinkObject state.Sink) {
    25  	p.beforeSave()
    26  	var ptrValue *bucket
    27  	ptrValue = p.savePtr()
    28  	stateSinkObject.SaveValue(0, ptrValue)
    29  }
    30  
    31  func (p *AtomicPtrBucket) afterLoad(context.Context) {}
    32  
    33  // +checklocksignore
    34  func (p *AtomicPtrBucket) StateLoad(ctx context.Context, stateSourceObject state.Source) {
    35  	stateSourceObject.LoadValue(0, new(*bucket), func(y any) { p.loadPtr(ctx, y.(*bucket)) })
    36  }
    37  
    38  func init() {
    39  	state.Register((*AtomicPtrBucket)(nil))
    40  }