-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathart_internal.cpp
32 lines (23 loc) · 947 Bytes
/
art_internal.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright 2021-2025 UnoDB contributors
// Should be the first include
#include "global.hpp" // IWYU pragma: keep
// IWYU pragma: no_include <__ostream/basic_ostream.h>
// IWYU pragma: no_include <span>
#include "art_internal.hpp" // IWYU pragma: keep
#include "art_common.hpp"
#include <cstddef>
#include <iomanip>
#include <iostream> // IWYU pragma: keep
namespace unodb::detail {
[[gnu::cold]] UNODB_DETAIL_NOINLINE void dump_byte(std::ostream &os,
std::byte byte) {
os << ' ' << std::hex << std::setfill('0') << std::setw(2)
<< static_cast<unsigned>(byte) << std::dec;
}
[[gnu::cold]] UNODB_DETAIL_NOINLINE void dump_val(std::ostream &os,
unodb::value_view v) {
const auto sz = v.size_bytes();
os << "val(" << sz << "): 0x";
for (std::size_t i = 0; i < sz; ++i) dump_byte(os, v[i]);
}
} // namespace unodb::detail