MCPcopy Index your code
hub / github.com/Shopify/go-lua / writeString

Method writeString

dump.go:88–106  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

86}
87
88func (d *dumpState) writeString(s string) {
89 ba := []byte(s)
90 size := len(s)
91 if size > 0 {
92 size++ //accounts for 0 byte at the end
93 }
94 switch header.PointerSize {
95 case 8:
96 d.write(uint64(size))
97 case 4:
98 d.write(uint32(size))
99 default:
100 panic(fmt.Sprintf("unsupported pointer size (%d)", header.PointerSize))
101 }
102 if size > 0 {
103 d.write(ba)
104 d.writeByte(0)
105 }
106}
107
108func (d *dumpState) writeLocalVariables(p *prototype) {
109 d.writeInt(len(p.localVariables))

Callers 3

writeConstantsMethod · 0.95
writeLocalVariablesMethod · 0.95
writeDebugMethod · 0.95

Calls 2

writeMethod · 0.95
writeByteMethod · 0.95

Tested by

no test coverage detected