// automatically generated by stateify.

package kernel

import (
	"context"

	"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(context.Context) {}

// +checklocksignore
func (p *descriptorBucketSliceAtomicPtr) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.LoadValue(0, new(*descriptorBucketSlice), func(y any) { p.loadPtr(ctx, 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(context.Context) {}

// +checklocksignore
func (p *descriptorBucketAtomicPtr) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.LoadValue(0, new(*descriptorBucket), func(y any) { p.loadPtr(ctx, 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(context.Context) {}

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

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