MCPcopy Create free account
hub / github.com/google/gapid / writeValues

Method writeValues

gapis/replay/builder/constant_encoder.go:47–82  ·  view source on GitHub ↗
(v ...value.Value)

Source from the content-addressed store, hash-verified

45}
46
47func (e *constantEncoder) writeValues(v ...value.Value) value.Pointer {
48 if len(v) == 0 {
49 panic("Cannot write an empty list of values!")
50 }
51
52 e.begin()
53 for _, v := range v {
54 switch v := v.(type) {
55 case value.Bool:
56 e.writer.Bool(bool(v))
57 case value.U8:
58 e.writer.Uint8(uint8(v))
59 case value.S8:
60 e.writer.Int8(int8(v))
61 case value.U16:
62 e.writer.Uint16(uint16(v))
63 case value.S16:
64 e.writer.Int16(int16(v))
65 case value.F32:
66 e.writer.Float32(float32(v))
67 case value.U32:
68 e.writer.Uint32(uint32(v))
69 case value.S32:
70 e.writer.Int32(int32(v))
71 case value.F64:
72 e.writer.Float64(float64(v))
73 case value.U64:
74 e.writer.Uint64(uint64(v))
75 case value.S64:
76 e.writer.Int64(int64(v))
77 default:
78 panic(fmt.Errorf("Cannot write Value %T to constant memory", v))
79 }
80 }
81 return e.finish()
82}
83
84func (e *constantEncoder) writeString(s string) value.Pointer {
85 e.begin()

Callers 3

TestConstantEncoderCacheFunction · 0.80
BufferMethod · 0.80

Calls 13

beginMethod · 0.95
finishMethod · 0.95
BoolMethod · 0.65
Uint8Method · 0.65
Int8Method · 0.65
Uint16Method · 0.65
Int16Method · 0.65
Float32Method · 0.65
Uint32Method · 0.65
Int32Method · 0.65
Float64Method · 0.65
Uint64Method · 0.65

Tested by 2

TestConstantEncoderCacheFunction · 0.64