| 61 | reserved = 0; |
| 62 | } |
| 63 | void clearReserve(int size) { |
| 64 | str = Standalone<StringRef>(); |
| 65 | reserved = size; |
| 66 | str.contents() = StringRef(new (str.arena()) uint8_t[size], 0); |
| 67 | } |
| 68 | void append(StringRef x) { memcpy(append(x.size()), x.begin(), x.size()); } |
| 69 | void* append(int bytes) { |
| 70 | ASSERT(str.size() + bytes <= reserved); |