// automatically generated by stateify.

package buffer

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

func (x *buffer) beforeSave() {}
func (x *buffer) save(m state.Map) {
	x.beforeSave()
	m.Save("data", &x.data)
	m.Save("read", &x.read)
	m.Save("write", &x.write)
	m.Save("bufferEntry", &x.bufferEntry)
}

func (x *buffer) afterLoad() {}
func (x *buffer) load(m state.Map) {
	m.Load("data", &x.data)
	m.Load("read", &x.read)
	m.Load("write", &x.write)
	m.Load("bufferEntry", &x.bufferEntry)
}

func (x *bufferList) beforeSave() {}
func (x *bufferList) save(m state.Map) {
	x.beforeSave()
	m.Save("head", &x.head)
	m.Save("tail", &x.tail)
}

func (x *bufferList) afterLoad() {}
func (x *bufferList) load(m state.Map) {
	m.Load("head", &x.head)
	m.Load("tail", &x.tail)
}

func (x *bufferEntry) beforeSave() {}
func (x *bufferEntry) save(m state.Map) {
	x.beforeSave()
	m.Save("next", &x.next)
	m.Save("prev", &x.prev)
}

func (x *bufferEntry) afterLoad() {}
func (x *bufferEntry) load(m state.Map) {
	m.Load("next", &x.next)
	m.Load("prev", &x.prev)
}

func (x *View) beforeSave() {}
func (x *View) save(m state.Map) {
	x.beforeSave()
	m.Save("data", &x.data)
	m.Save("size", &x.size)
}

func (x *View) afterLoad() {}
func (x *View) load(m state.Map) {
	m.Load("data", &x.data)
	m.Load("size", &x.size)
}

func init() {
	state.Register("pkg/buffer.buffer", (*buffer)(nil), state.Fns{Save: (*buffer).save, Load: (*buffer).load})
	state.Register("pkg/buffer.bufferList", (*bufferList)(nil), state.Fns{Save: (*bufferList).save, Load: (*bufferList).load})
	state.Register("pkg/buffer.bufferEntry", (*bufferEntry)(nil), state.Fns{Save: (*bufferEntry).save, Load: (*bufferEntry).load})
	state.Register("pkg/buffer.View", (*View)(nil), state.Fns{Save: (*View).save, Load: (*View).load})
}