MCPcopy Create free account
hub / github.com/google/gvisor / load

Method load

pkg/state/decode.go:361–373  ·  view source on GitHub ↗

load is helper for the public methods on Source.

(slot int, objPtr reflect.Value, wait bool, fn func())

Source from the content-addressed store, hash-verified

359
360// load is helper for the public methods on Source.
361func (od *objectDecoder) load(slot int, objPtr reflect.Value, wait bool, fn func()) {
362 // Note that we have reconciled the type and may remap the fields here
363 // to match what's expected by the decoder. The "slot" parameter here
364 // is in terms of the local type, where the fields in the encoded
365 // object are in terms of the wire object's type, which might be in a
366 // different order (but will have the same fields).
367 v := *od.encoded.Field(od.rte.FieldOrder[slot])
368 od.ds.decodeObject(od.ods, objPtr.Elem(), v)
369 if wait {
370 // Mark this individual object a blocker.
371 od.ds.waitObject(od.ods, v, fn)
372 }
373}
374
375// aterLoad implements Source.AfterLoad.
376func (od *objectDecoder) afterLoad(fn func()) {

Callers

nothing calls this directly

Calls 4

FieldMethod · 0.80
decodeObjectMethod · 0.80
ElemMethod · 0.80
waitObjectMethod · 0.80

Tested by

no test coverage detected