Copies the StringView 'srcStr' to storage owned by 'this'. Creates a new StringView at 'offset' in 'group' pointing to the copy. A large string may be copied into non-contiguous allocation pieces. The size in the StringView is the sum of the sizes. The pieces are linked via Headers, the first header is below the first byte of the StringView's data. StringViews written by this are to be read with c
| 201 | // written by this are to be read with contiguousString(). This is nearly |
| 202 | // always zero copy but will accommodate the odd extra large string. |
| 203 | void copyMultipart(const StringView& str, char* group, int32_t offset) { |
| 204 | if (str.isInline()) { |
| 205 | *reinterpret_cast<StringView*>(group + offset) = str; |
| 206 | return; |
| 207 | } |
| 208 | copyMultipartNoInline(str, group, offset); |
| 209 | } |
| 210 | |
| 211 | // Returns a contiguous view on 'view', where 'view' comes from |
| 212 | // copyMultipart(). Uses 'storage' to own a possible temporary |