• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

llnl / dftracer-utils / 28286012595

27 Jun 2026 10:04AM UTC coverage: 51.056% (-1.3%) from 52.356%
28286012595

Pull #79

github

web-flow
Merge 6c6535a19 into 8eb383f39
Pull Request #79: Add Valgrind memory checking (C++, Python, MPI) and fix the bugs it found

32079 of 80165 branches covered (40.02%)

Branch coverage included in aggregate %.

129 of 149 new or added lines in 11 files covered. (86.58%)

5116 existing lines in 181 files now uncovered.

32739 of 46790 relevant lines covered (69.97%)

9929.31 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

79.75
/src/dftracer/utils/core/rocksdb/key_codec.cpp
1
#include <dftracer/utils/core/rocksdb/key_codec.h>
2

3
#include <stdexcept>
4

5
namespace dftracer::utils::rocksdb {
6

7
namespace {
8

9
template <typename T>
10
T decode_big_endian(std::string_view bytes) {
283,893✔
11
    if (bytes.size() != sizeof(T)) {
283,893!
12
        throw std::invalid_argument(
×
13
            "KeyCodec: invalid big-endian integer width");
14
    }
15

16
    T value = 0;
283,893✔
17
    for (unsigned char byte : bytes) {
2,400,108✔
18
        value = static_cast<T>((value << 8U) | byte);
2,116,215✔
19
    }
20
    return value;
283,893✔
UNCOV
21
}
×
22

23
}  // namespace
24

25
std::string KeyCodec::encode_be32(std::uint32_t value) {
16,481✔
26
    std::string out;
16,481✔
27
    out.reserve(sizeof(value));
16,481✔
28
    append_be32(out, value);
16,480✔
29
    return out;
16,479✔
30
}
16,481!
31

32
std::string KeyCodec::encode_be64(std::uint64_t value) {
1,445✔
33
    std::string out;
1,445✔
34
    out.reserve(sizeof(value));
1,445!
35
    append_be64(out, value);
1,445!
36
    return out;
1,445✔
37
}
1,445!
38

39
std::uint32_t KeyCodec::decode_be32(std::string_view bytes) {
38,669✔
40
    return decode_big_endian<std::uint32_t>(bytes);
38,669✔
41
}
42

43
std::uint64_t KeyCodec::decode_be64(std::string_view bytes) {
245,231✔
44
    return decode_big_endian<std::uint64_t>(bytes);
245,231✔
45
}
46

47
void KeyCodec::append_be32(std::string& out, std::uint32_t value) {
68,153✔
48
    for (int shift = 24; shift >= 0; shift -= 8) {
340,718✔
49
        out.push_back(static_cast<char>((value >> shift) & 0xFFU));
272,565✔
50
    }
272,565✔
51
}
68,153✔
52

53
void KeyCodec::append_be64(std::string& out, std::uint64_t value) {
69,888✔
54
    for (int shift = 56; shift >= 0; shift -= 8) {
628,573✔
55
        out.push_back(static_cast<char>((value >> shift) & 0xFFU));
558,685✔
56
    }
558,685✔
57
}
69,888✔
58

59
KeyBuilder& KeyBuilder::append_tag(std::string_view tag) {
1✔
60
    key_.append(tag);
1✔
61
    return *this;
1✔
62
}
63

64
KeyBuilder& KeyBuilder::append_separator() {
1✔
65
    key_.push_back('\0');
1✔
66
    return *this;
1✔
67
}
68

69
KeyBuilder& KeyBuilder::append_string(std::string_view value) {
×
70
    key_.append(value);
×
71
    return *this;
×
72
}
73

74
KeyBuilder& KeyBuilder::append_be32(std::uint32_t value) {
1✔
75
    KeyCodec::append_be32(key_, value);
1✔
76
    return *this;
1✔
77
}
78

79
KeyBuilder& KeyBuilder::append_be64(std::uint64_t value) {
1✔
80
    KeyCodec::append_be64(key_, value);
1✔
81
    return *this;
1✔
82
}
83

84
std::string KeyBuilder::build() const { return key_; }
1✔
85

86
void KeyBuilder::clear() { key_.clear(); }
×
87

88
}  // namespace dftracer::utils::rocksdb
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc