MCPcopy Create free account
hub / github.com/apache/impala / append

Method append

be/src/kudu/util/faststring.h:147–166  ·  view source on GitHub ↗

Append the given data to the string, resizing capacity as necessary.

Source from the content-addressed store, hash-verified

145
146 // Append the given data to the string, resizing capacity as necessary.
147 void append(const void *src_v, size_t count) {
148 const uint8_t *src = reinterpret_cast<const uint8_t *>(src_v);
149 EnsureRoomForAppend(count);
150 ASAN_UNPOISON_MEMORY_REGION(data_ + len_, count);
151
152 // appending short values is common enough that this
153 // actually helps, according to benchmarks. In theory
154 // memcpy_inlined should already be just as good, but this
155 // was ~20% faster for reading a large prefix-coded string file
156 // where each string was only a few chars different
157 if (count <= 4) {
158 uint8_t *p = &data_[len_];
159 for (int i = 0; i < count; i++) {
160 *p++ = *src++;
161 }
162 } else {
163 strings::memcpy_inlined(&data_[len_], src, count);
164 }
165 len_ += count;
166 }
167
168 // Append the given string to this string.
169 void append(const std::string &str) {

Callers 15

lFunction · 0.45
d3.v5.min.jsFile · 0.45
uFunction · 0.45
nFunction · 0.45
normalFunction · 0.45
veeFunction · 0.45
createClustersFunction · 0.45
createEdgeLabelsFunction · 0.45
createEdgePathsFunction · 0.45
createNodesFunction · 0.45
addHtmlLabelFunction · 0.45
addLabelFunction · 0.45

Calls 3

memcpy_inlinedFunction · 0.85
dataMethod · 0.45
sizeMethod · 0.45