MCPcopy Create free account
hub / github.com/arvidn/libtorrent / generate_block_fill

Function generate_block_fill

tools/checking_benchmark.cpp:52–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50namespace {
51
52void generate_block_fill(lt::span<char> buf, std::uint64_t& state)
53{
54 int const tail = buf.size() % 8;
55 int offset = 0;
56 for (; offset < buf.size() - tail; offset += 8)
57 {
58 std::memcpy(buf.data() + offset, reinterpret_cast<char const*>(&state), 8);
59 ++state;
60 }
61 if (tail > 0)
62 {
63 std::memcpy(buf.data() + offset, reinterpret_cast<char const*>(&state), tail);
64 ++state;
65 }
66}
67
68std::vector<char> generate_torrent(int num_pieces, std::string save_path
69 , lt::create_flags_t const flags)

Callers 1

generate_torrentFunction · 0.70

Calls 2

sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected