(s, content)
| 10 | } |
| 11 | } |
| 12 | function writeStdString(s, content) { |
| 13 | var flag = s.add(23).readU8() |
| 14 | if (flag == 0x80) { |
| 15 | // 从堆中写入 |
| 16 | var orisize = s.add(8).readUInt() |
| 17 | if (content.length > orisize) { |
| 18 | throw "must below orisize!" |
| 19 | } |
| 20 | s.readPointer().writeUtf8String(content) |
| 21 | s.add(8).writeUInt(content.length) |
| 22 | } else { |
| 23 | // 从栈中写入 |
| 24 | if (content.length > 22) { |
| 25 | throw "max 23 for stack str" |
| 26 | } |
| 27 | s.writeUtf8String(content) |
| 28 | s.add(23).writeU8(content.length) |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | |
| 33 |
nothing calls this directly
no outgoing calls
no test coverage detected