// automatically generated by stateify.

package kernel

import (
	"gvisor.dev/gvisor/pkg/state"
)

func (p *descriptorBucketSliceAtomicPtr) StateTypeName() string {
	return "pkg/sentry/kernel.descriptorBucketSliceAtomicPtr"
}

func (p *descriptorBucketSliceAtomicPtr) StateFields() []string {
	return []string{
		"ptr",
	}
}

func (p *descriptorBucketSliceAtomicPtr) beforeSave() {}

// +checklocksignore
func (p *descriptorBucketSliceAtomicPtr) StateSave(stateSinkObject state.Sink) {
	p.beforeSave()
	var ptrValue *descriptorBucketSlice
	ptrValue = p.savePtr()
	stateSinkObject.SaveValue(0, ptrValue)
}

func (p *descriptorBucketSliceAtomicPtr) afterLoad() {}

// +checklocksignore
func (p *descriptorBucketSliceAtomicPtr) StateLoad(stateSourceObject state.Source) {
	stateSourceObject.LoadValue(0, new(*descriptorBucketSlice), func(y any) { p.loadPtr(y.(*descriptorBucketSlice)) })
}

func (p *descriptorBucketAtomicPtr) StateTypeName() string {
	return "pkg/sentry/kernel.descriptorBucketAtomicPtr"
}

func (p *descriptorBucketAtomicPtr) StateFields() []string {
	return []string{
		"ptr",
	}
}

func (p *descriptorBucketAtomicPtr) beforeSave() {}

// +checklocksignore
func (p *descriptorBucketAtomicPtr) StateSave(stateSinkObject state.Sink) {
	p.beforeSave()
	var ptrValue *descriptorBucket
	ptrValue = p.savePtr()
	stateSinkObject.SaveValue(0, ptrValue)
}

func (p *descriptorBucketAtomicPtr) afterLoad() {}

// +checklocksignore
func (p *descriptorBucketAtomicPtr) StateLoad(stateSourceObject state.Source) {
	stateSourceObject.LoadValue(0, new(*descriptorBucket), func(y any) { p.loadPtr(y.(*descriptorBucket)) })
}

func (p *descriptorAtomicPtr) StateTypeName() string {
	return "pkg/sentry/kernel.descriptorAtomicPtr"
}

func (p *descriptorAtomicPtr) StateFields() []string {
	return []string{
		"ptr",
	}
}

func (p *descriptorAtomicPtr) beforeSave() {}

// +checklocksignore
func (p *descriptorAtomicPtr) StateSave(stateSinkObject state.Sink) {
	p.beforeSave()
	var ptrValue *descriptor
	ptrValue = p.savePtr()
	stateSinkObject.SaveValue(0, ptrValue)
}

func (p *descriptorAtomicPtr) afterLoad() {}

// +checklocksignore
func (p *descriptorAtomicPtr) StateLoad(stateSourceObject state.Source) {
	stateSourceObject.LoadValue(0, new(*descriptor), func(y any) { p.loadPtr(y.(*descriptor)) })
}

func init() {
	state.Register((*descriptorBucketSliceAtomicPtr)(nil))
	state.Register((*descriptorBucketAtomicPtr)(nil))
	state.Register((*descriptorAtomicPtr)(nil))
}
