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

Function makeLargeString

bolt/exec/tests/RowContainerTest.cpp:713–722  ·  view source on GitHub ↗

Makes a string with deterministic distinct content.

Source from the content-addressed store, hash-verified

711
712// Makes a string with deterministic distinct content.
713void makeLargeString(int32_t approxSize, std::string& string) {
714 string.reserve(approxSize);
715 while (string.size() < string.capacity() - 20) {
716 auto size = string.size();
717 auto number =
718 fmt::format("{}", (size + 1 + approxSize) * 0xc6a4a7935bd1e995L);
719 string.resize(size + number.size());
720 memcpy(&string[size], &number[0], number.size());
721 }
722}
723} // namespace
724
725namespace {

Callers 1

TEST_PFunction · 0.85

Calls 5

memcpyFunction · 0.85
reserveMethod · 0.45
sizeMethod · 0.45
capacityMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected