MCPcopy Create free account
hub / github.com/bytedance/bolt / copyMultipart

Method copyMultipart

bolt/common/memory/HashStringAllocator.h:203–209  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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

Callers 4

storeVariableSizeAtMethod · 0.80
storeWithNullsFunction · 0.80
storeNoNullsFunction · 0.80
TEST_FFunction · 0.80

Calls 1

isInlineMethod · 0.80

Tested by 1

TEST_FFunction · 0.64