github.com/metacubex/gvisor@v0.0.0-20240320004321-933faba989ec/pkg/sentry/pgalloc/pgalloc_state_autogen.go (about)

     1  // automatically generated by stateify.
     2  
     3  package pgalloc
     4  
     5  import (
     6  	"context"
     7  
     8  	"github.com/metacubex/gvisor/pkg/state"
     9  )
    10  
    11  func (r *EvictableRange) StateTypeName() string {
    12  	return "pkg/sentry/pgalloc.EvictableRange"
    13  }
    14  
    15  func (r *EvictableRange) StateFields() []string {
    16  	return []string{
    17  		"Start",
    18  		"End",
    19  	}
    20  }
    21  
    22  func (r *EvictableRange) beforeSave() {}
    23  
    24  // +checklocksignore
    25  func (r *EvictableRange) StateSave(stateSinkObject state.Sink) {
    26  	r.beforeSave()
    27  	stateSinkObject.Save(0, &r.Start)
    28  	stateSinkObject.Save(1, &r.End)
    29  }
    30  
    31  func (r *EvictableRange) afterLoad(context.Context) {}
    32  
    33  // +checklocksignore
    34  func (r *EvictableRange) StateLoad(ctx context.Context, stateSourceObject state.Source) {
    35  	stateSourceObject.Load(0, &r.Start)
    36  	stateSourceObject.Load(1, &r.End)
    37  }
    38  
    39  func (s *evictableRangeSet) StateTypeName() string {
    40  	return "pkg/sentry/pgalloc.evictableRangeSet"
    41  }
    42  
    43  func (s *evictableRangeSet) StateFields() []string {
    44  	return []string{
    45  		"root",
    46  	}
    47  }
    48  
    49  func (s *evictableRangeSet) beforeSave() {}
    50  
    51  // +checklocksignore
    52  func (s *evictableRangeSet) StateSave(stateSinkObject state.Sink) {
    53  	s.beforeSave()
    54  	var rootValue []evictableRangeFlatSegment
    55  	rootValue = s.saveRoot()
    56  	stateSinkObject.SaveValue(0, rootValue)
    57  }
    58  
    59  func (s *evictableRangeSet) afterLoad(context.Context) {}
    60  
    61  // +checklocksignore
    62  func (s *evictableRangeSet) StateLoad(ctx context.Context, stateSourceObject state.Source) {
    63  	stateSourceObject.LoadValue(0, new([]evictableRangeFlatSegment), func(y any) { s.loadRoot(ctx, y.([]evictableRangeFlatSegment)) })
    64  }
    65  
    66  func (n *evictableRangenode) StateTypeName() string {
    67  	return "pkg/sentry/pgalloc.evictableRangenode"
    68  }
    69  
    70  func (n *evictableRangenode) StateFields() []string {
    71  	return []string{
    72  		"nrSegments",
    73  		"parent",
    74  		"parentIndex",
    75  		"hasChildren",
    76  		"maxGap",
    77  		"keys",
    78  		"values",
    79  		"children",
    80  	}
    81  }
    82  
    83  func (n *evictableRangenode) beforeSave() {}
    84  
    85  // +checklocksignore
    86  func (n *evictableRangenode) StateSave(stateSinkObject state.Sink) {
    87  	n.beforeSave()
    88  	stateSinkObject.Save(0, &n.nrSegments)
    89  	stateSinkObject.Save(1, &n.parent)
    90  	stateSinkObject.Save(2, &n.parentIndex)
    91  	stateSinkObject.Save(3, &n.hasChildren)
    92  	stateSinkObject.Save(4, &n.maxGap)
    93  	stateSinkObject.Save(5, &n.keys)
    94  	stateSinkObject.Save(6, &n.values)
    95  	stateSinkObject.Save(7, &n.children)
    96  }
    97  
    98  func (n *evictableRangenode) afterLoad(context.Context) {}
    99  
   100  // +checklocksignore
   101  func (n *evictableRangenode) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   102  	stateSourceObject.Load(0, &n.nrSegments)
   103  	stateSourceObject.Load(1, &n.parent)
   104  	stateSourceObject.Load(2, &n.parentIndex)
   105  	stateSourceObject.Load(3, &n.hasChildren)
   106  	stateSourceObject.Load(4, &n.maxGap)
   107  	stateSourceObject.Load(5, &n.keys)
   108  	stateSourceObject.Load(6, &n.values)
   109  	stateSourceObject.Load(7, &n.children)
   110  }
   111  
   112  func (e *evictableRangeFlatSegment) StateTypeName() string {
   113  	return "pkg/sentry/pgalloc.evictableRangeFlatSegment"
   114  }
   115  
   116  func (e *evictableRangeFlatSegment) StateFields() []string {
   117  	return []string{
   118  		"Start",
   119  		"End",
   120  		"Value",
   121  	}
   122  }
   123  
   124  func (e *evictableRangeFlatSegment) beforeSave() {}
   125  
   126  // +checklocksignore
   127  func (e *evictableRangeFlatSegment) StateSave(stateSinkObject state.Sink) {
   128  	e.beforeSave()
   129  	stateSinkObject.Save(0, &e.Start)
   130  	stateSinkObject.Save(1, &e.End)
   131  	stateSinkObject.Save(2, &e.Value)
   132  }
   133  
   134  func (e *evictableRangeFlatSegment) afterLoad(context.Context) {}
   135  
   136  // +checklocksignore
   137  func (e *evictableRangeFlatSegment) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   138  	stateSourceObject.Load(0, &e.Start)
   139  	stateSourceObject.Load(1, &e.End)
   140  	stateSourceObject.Load(2, &e.Value)
   141  }
   142  
   143  func (u *usageInfo) StateTypeName() string {
   144  	return "pkg/sentry/pgalloc.usageInfo"
   145  }
   146  
   147  func (u *usageInfo) StateFields() []string {
   148  	return []string{
   149  		"kind",
   150  		"knownCommitted",
   151  		"refs",
   152  		"memCgID",
   153  	}
   154  }
   155  
   156  func (u *usageInfo) beforeSave() {}
   157  
   158  // +checklocksignore
   159  func (u *usageInfo) StateSave(stateSinkObject state.Sink) {
   160  	u.beforeSave()
   161  	stateSinkObject.Save(0, &u.kind)
   162  	stateSinkObject.Save(1, &u.knownCommitted)
   163  	stateSinkObject.Save(2, &u.refs)
   164  	stateSinkObject.Save(3, &u.memCgID)
   165  }
   166  
   167  func (u *usageInfo) afterLoad(context.Context) {}
   168  
   169  // +checklocksignore
   170  func (u *usageInfo) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   171  	stateSourceObject.Load(0, &u.kind)
   172  	stateSourceObject.Load(1, &u.knownCommitted)
   173  	stateSourceObject.Load(2, &u.refs)
   174  	stateSourceObject.Load(3, &u.memCgID)
   175  }
   176  
   177  func (s *reclaimSet) StateTypeName() string {
   178  	return "pkg/sentry/pgalloc.reclaimSet"
   179  }
   180  
   181  func (s *reclaimSet) StateFields() []string {
   182  	return []string{
   183  		"root",
   184  	}
   185  }
   186  
   187  func (s *reclaimSet) beforeSave() {}
   188  
   189  // +checklocksignore
   190  func (s *reclaimSet) StateSave(stateSinkObject state.Sink) {
   191  	s.beforeSave()
   192  	var rootValue []reclaimFlatSegment
   193  	rootValue = s.saveRoot()
   194  	stateSinkObject.SaveValue(0, rootValue)
   195  }
   196  
   197  func (s *reclaimSet) afterLoad(context.Context) {}
   198  
   199  // +checklocksignore
   200  func (s *reclaimSet) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   201  	stateSourceObject.LoadValue(0, new([]reclaimFlatSegment), func(y any) { s.loadRoot(ctx, y.([]reclaimFlatSegment)) })
   202  }
   203  
   204  func (n *reclaimnode) StateTypeName() string {
   205  	return "pkg/sentry/pgalloc.reclaimnode"
   206  }
   207  
   208  func (n *reclaimnode) StateFields() []string {
   209  	return []string{
   210  		"nrSegments",
   211  		"parent",
   212  		"parentIndex",
   213  		"hasChildren",
   214  		"maxGap",
   215  		"keys",
   216  		"values",
   217  		"children",
   218  	}
   219  }
   220  
   221  func (n *reclaimnode) beforeSave() {}
   222  
   223  // +checklocksignore
   224  func (n *reclaimnode) StateSave(stateSinkObject state.Sink) {
   225  	n.beforeSave()
   226  	stateSinkObject.Save(0, &n.nrSegments)
   227  	stateSinkObject.Save(1, &n.parent)
   228  	stateSinkObject.Save(2, &n.parentIndex)
   229  	stateSinkObject.Save(3, &n.hasChildren)
   230  	stateSinkObject.Save(4, &n.maxGap)
   231  	stateSinkObject.Save(5, &n.keys)
   232  	stateSinkObject.Save(6, &n.values)
   233  	stateSinkObject.Save(7, &n.children)
   234  }
   235  
   236  func (n *reclaimnode) afterLoad(context.Context) {}
   237  
   238  // +checklocksignore
   239  func (n *reclaimnode) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   240  	stateSourceObject.Load(0, &n.nrSegments)
   241  	stateSourceObject.Load(1, &n.parent)
   242  	stateSourceObject.Load(2, &n.parentIndex)
   243  	stateSourceObject.Load(3, &n.hasChildren)
   244  	stateSourceObject.Load(4, &n.maxGap)
   245  	stateSourceObject.Load(5, &n.keys)
   246  	stateSourceObject.Load(6, &n.values)
   247  	stateSourceObject.Load(7, &n.children)
   248  }
   249  
   250  func (r *reclaimFlatSegment) StateTypeName() string {
   251  	return "pkg/sentry/pgalloc.reclaimFlatSegment"
   252  }
   253  
   254  func (r *reclaimFlatSegment) StateFields() []string {
   255  	return []string{
   256  		"Start",
   257  		"End",
   258  		"Value",
   259  	}
   260  }
   261  
   262  func (r *reclaimFlatSegment) beforeSave() {}
   263  
   264  // +checklocksignore
   265  func (r *reclaimFlatSegment) StateSave(stateSinkObject state.Sink) {
   266  	r.beforeSave()
   267  	stateSinkObject.Save(0, &r.Start)
   268  	stateSinkObject.Save(1, &r.End)
   269  	stateSinkObject.Save(2, &r.Value)
   270  }
   271  
   272  func (r *reclaimFlatSegment) afterLoad(context.Context) {}
   273  
   274  // +checklocksignore
   275  func (r *reclaimFlatSegment) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   276  	stateSourceObject.Load(0, &r.Start)
   277  	stateSourceObject.Load(1, &r.End)
   278  	stateSourceObject.Load(2, &r.Value)
   279  }
   280  
   281  func (s *usageSet) StateTypeName() string {
   282  	return "pkg/sentry/pgalloc.usageSet"
   283  }
   284  
   285  func (s *usageSet) StateFields() []string {
   286  	return []string{
   287  		"root",
   288  	}
   289  }
   290  
   291  func (s *usageSet) beforeSave() {}
   292  
   293  // +checklocksignore
   294  func (s *usageSet) StateSave(stateSinkObject state.Sink) {
   295  	s.beforeSave()
   296  	var rootValue []usageFlatSegment
   297  	rootValue = s.saveRoot()
   298  	stateSinkObject.SaveValue(0, rootValue)
   299  }
   300  
   301  func (s *usageSet) afterLoad(context.Context) {}
   302  
   303  // +checklocksignore
   304  func (s *usageSet) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   305  	stateSourceObject.LoadValue(0, new([]usageFlatSegment), func(y any) { s.loadRoot(ctx, y.([]usageFlatSegment)) })
   306  }
   307  
   308  func (n *usagenode) StateTypeName() string {
   309  	return "pkg/sentry/pgalloc.usagenode"
   310  }
   311  
   312  func (n *usagenode) StateFields() []string {
   313  	return []string{
   314  		"nrSegments",
   315  		"parent",
   316  		"parentIndex",
   317  		"hasChildren",
   318  		"maxGap",
   319  		"keys",
   320  		"values",
   321  		"children",
   322  	}
   323  }
   324  
   325  func (n *usagenode) beforeSave() {}
   326  
   327  // +checklocksignore
   328  func (n *usagenode) StateSave(stateSinkObject state.Sink) {
   329  	n.beforeSave()
   330  	stateSinkObject.Save(0, &n.nrSegments)
   331  	stateSinkObject.Save(1, &n.parent)
   332  	stateSinkObject.Save(2, &n.parentIndex)
   333  	stateSinkObject.Save(3, &n.hasChildren)
   334  	stateSinkObject.Save(4, &n.maxGap)
   335  	stateSinkObject.Save(5, &n.keys)
   336  	stateSinkObject.Save(6, &n.values)
   337  	stateSinkObject.Save(7, &n.children)
   338  }
   339  
   340  func (n *usagenode) afterLoad(context.Context) {}
   341  
   342  // +checklocksignore
   343  func (n *usagenode) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   344  	stateSourceObject.Load(0, &n.nrSegments)
   345  	stateSourceObject.Load(1, &n.parent)
   346  	stateSourceObject.Load(2, &n.parentIndex)
   347  	stateSourceObject.Load(3, &n.hasChildren)
   348  	stateSourceObject.Load(4, &n.maxGap)
   349  	stateSourceObject.Load(5, &n.keys)
   350  	stateSourceObject.Load(6, &n.values)
   351  	stateSourceObject.Load(7, &n.children)
   352  }
   353  
   354  func (u *usageFlatSegment) StateTypeName() string {
   355  	return "pkg/sentry/pgalloc.usageFlatSegment"
   356  }
   357  
   358  func (u *usageFlatSegment) StateFields() []string {
   359  	return []string{
   360  		"Start",
   361  		"End",
   362  		"Value",
   363  	}
   364  }
   365  
   366  func (u *usageFlatSegment) beforeSave() {}
   367  
   368  // +checklocksignore
   369  func (u *usageFlatSegment) StateSave(stateSinkObject state.Sink) {
   370  	u.beforeSave()
   371  	stateSinkObject.Save(0, &u.Start)
   372  	stateSinkObject.Save(1, &u.End)
   373  	stateSinkObject.Save(2, &u.Value)
   374  }
   375  
   376  func (u *usageFlatSegment) afterLoad(context.Context) {}
   377  
   378  // +checklocksignore
   379  func (u *usageFlatSegment) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   380  	stateSourceObject.Load(0, &u.Start)
   381  	stateSourceObject.Load(1, &u.End)
   382  	stateSourceObject.Load(2, &u.Value)
   383  }
   384  
   385  func init() {
   386  	state.Register((*EvictableRange)(nil))
   387  	state.Register((*evictableRangeSet)(nil))
   388  	state.Register((*evictableRangenode)(nil))
   389  	state.Register((*evictableRangeFlatSegment)(nil))
   390  	state.Register((*usageInfo)(nil))
   391  	state.Register((*reclaimSet)(nil))
   392  	state.Register((*reclaimnode)(nil))
   393  	state.Register((*reclaimFlatSegment)(nil))
   394  	state.Register((*usageSet)(nil))
   395  	state.Register((*usagenode)(nil))
   396  	state.Register((*usageFlatSegment)(nil))
   397  }