// automatically generated by stateify.

package limits

import (
	"context"

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

func (l *Limit) StateTypeName() string {
	return "pkg/sentry/limits.Limit"
}

func (l *Limit) StateFields() []string {
	return []string{
		"Cur",
		"Max",
	}
}

func (l *Limit) beforeSave() {}

// +checklocksignore
func (l *Limit) StateSave(stateSinkObject state.Sink) {
	l.beforeSave()
	stateSinkObject.Save(0, &l.Cur)
	stateSinkObject.Save(1, &l.Max)
}

func (l *Limit) afterLoad(context.Context) {}

// +checklocksignore
func (l *Limit) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &l.Cur)
	stateSourceObject.Load(1, &l.Max)
}

func (l *LimitSet) StateTypeName() string {
	return "pkg/sentry/limits.LimitSet"
}

func (l *LimitSet) StateFields() []string {
	return []string{
		"data",
	}
}

func (l *LimitSet) beforeSave() {}

// +checklocksignore
func (l *LimitSet) StateSave(stateSinkObject state.Sink) {
	l.beforeSave()
	stateSinkObject.Save(0, &l.data)
}

func (l *LimitSet) afterLoad(context.Context) {}

// +checklocksignore
func (l *LimitSet) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &l.data)
}

func init() {
	state.Register((*Limit)(nil))
	state.Register((*LimitSet)(nil))
}
