Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions art.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
#define UNODB_DETAIL_ART_HPP

// Should be the first include
#include "global.hpp" // IWYU pragma: keep
#include "global.hpp"

// IWYU pragma: no_include <__ostream/basic_ostream.h>

#include <cstddef>
#include <cstdint>
#include <iostream>
#include <limits>
#include <optional>
#include <stack>
#include <type_traits>
Expand All @@ -27,7 +25,7 @@ namespace unodb {
namespace detail {

template <typename Key, typename Value>
class inode; // IWYU pragma: keep
class inode;

template <typename Key, typename Value>
class inode_4;
Expand Down
9 changes: 2 additions & 7 deletions art_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,13 @@
#define UNODB_DETAIL_ART_COMMON_HPP

// Should be the first include
#include "global.hpp" // IWYU pragma: keep
#include "global.hpp"

// IWYU pragma: no_include <__fwd/ostream.h>
// IWYU pragma: no_include <ostream>
// IWYU pragma: no_include <ostream.h>

#include <cmath>
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <iomanip>
#include <iosfwd> // IWYU pragma: keep
#include <iosfwd>
#include <iostream>
#include <span>
#include <string_view>
Expand Down
3 changes: 1 addition & 2 deletions art_internal.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
// Copyright 2021-2025 UnoDB contributors

// Should be the first include
#include "global.hpp" // IWYU pragma: keep
#include "global.hpp"

// IWYU pragma: no_include <__ostream/basic_ostream.h>
// IWYU pragma: no_include <span>

#include "art_internal.hpp" // IWYU pragma: keep

Expand Down
3 changes: 2 additions & 1 deletion art_internal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
#define UNODB_DETAIL_ART_INTERNAL_HPP

// Should be the first include
#include "global.hpp" // IWYU pragma: keep
#include "global.hpp"

// IWYU pragma: no_include <__cstddef/byte.h>
// IWYU pragma: no_include <_string.h>

#include <algorithm>
Expand Down
2 changes: 1 addition & 1 deletion art_internal_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#define UNODB_DETAIL_ART_INTERNAL_IMPL_HPP

// Should be the first include
#include "global.hpp" // IWYU pragma: keep
#include "global.hpp"

#include <algorithm>
#include <array>
Expand Down
8 changes: 3 additions & 5 deletions benchmark/micro_benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@
// Should be the first include
#include "global.hpp" // IWYU pragma: keep

// IWYU pragma: no_include <__vector/vector.h>
// IWYU pragma: no_include <array>
// IWYU pragma: no_include <string>
// IWYU pragma: no_include <tuple>
// IWYU pragma: no_include <vector>
// IWYU pragma: no_forward_declare unodb::visitor

#include <array>
#include <cstddef>
#include <cstdint>
#include <utility> // IWYU pragma: keep
#include <tuple>

#include <benchmark/benchmark.h>

Expand Down
6 changes: 1 addition & 5 deletions benchmark/micro_benchmark_concurrency.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
#define UNODB_DETAIL_MICRO_BENCHMARK_CONCURRENCY_HPP

// Should be the first include
#include "global.hpp" // IWYU pragma: keep

#include <memory>
#include <thread>
#include <vector>
#include "global.hpp"

#include <benchmark/benchmark.h>

Expand Down
4 changes: 2 additions & 2 deletions benchmark/micro_benchmark_key_prefix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
// Should be the first include
#include "global.hpp" // IWYU pragma: keep

// IWYU pragma: no_include <string>
// IWYU pragma: no_include <__vector/vector.h>

#include <algorithm>
#include <cstdint>
#include <vector>
#include <vector> // IWYU pragma: keep

#include <benchmark/benchmark.h>

Expand Down
2 changes: 0 additions & 2 deletions benchmark/micro_benchmark_mutex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
// Should be the first include
#include "global.hpp" // IWYU pragma: keep

// IWYU pragma: no_include <string>

#include <thread>

#include <benchmark/benchmark.h>
Expand Down
2 changes: 0 additions & 2 deletions benchmark/micro_benchmark_n16.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
// Should be the first include
#include "global.hpp" // IWYU pragma: keep

// IWYU pragma: no_include <string>

#include <benchmark/benchmark.h>

#include "micro_benchmark_node_utils.hpp"
Expand Down
2 changes: 0 additions & 2 deletions benchmark/micro_benchmark_n256.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
// Should be the first include
#include "global.hpp" // IWYU pragma: keep

// IWYU pragma: no_include <string>

#include <benchmark/benchmark.h>

#include "micro_benchmark_node_utils.hpp"
Expand Down
3 changes: 2 additions & 1 deletion benchmark/micro_benchmark_n4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
#include "global.hpp" // IWYU pragma: keep

// IWYU pragma: no_include <string>
// IWYU pragma: no_include <__vector/vector.h>

#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <vector>
#include <vector> // IWYU pragma: keep

#include <benchmark/benchmark.h>

Expand Down
2 changes: 0 additions & 2 deletions benchmark/micro_benchmark_n48.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
// Should be the first include
#include "global.hpp" // IWYU pragma: keep

// IWYU pragma: no_include <string>

#include <benchmark/benchmark.h>

#include "micro_benchmark_node_utils.hpp"
Expand Down
9 changes: 5 additions & 4 deletions benchmark/micro_benchmark_node_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,22 @@
#define UNODB_DETAIL_MICRO_BENCHMARK_NODE_UTILS_HPP

// Should be the first include
#include "global.hpp" // IWYU pragma: keep
#include "global.hpp"

#include <algorithm>
#include <array>
#include <cstddef>
#include <cstdint>
#ifndef NDEBUG
#include <iostream>
#endif
#include <limits>
#include <random>
#include <string>
#include <tuple>
#include <vector>

#ifndef NDEBUG
#include <iostream>
#endif

#include <benchmark/benchmark.h>

#include "art_common.hpp"
Expand Down
4 changes: 2 additions & 2 deletions benchmark/micro_benchmark_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
// Should be the first include
#include "global.hpp" // IWYU pragma: keep

#include "micro_benchmark_utils.hpp"
#include "micro_benchmark_utils.hpp" // IWYU pragma: keep

#include <benchmark/benchmark.h>

#include "art.hpp" // IWYU pragma: keep
#include "art.hpp" // IWYU pragma: keep
#include "mutex_art.hpp" // IWYU pragma: keep
#include "olc_art.hpp" // IWYU pragma: keep

Expand Down
5 changes: 3 additions & 2 deletions benchmark/micro_benchmark_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
#define UNODB_DETAIL_MICRO_BENCHMARK_UTILS_HPP

// Should be the first include
#include "global.hpp" // IWYU pragma: keep
#include "global.hpp"

// IWYU pragma: no_include <__ostream/basic_ostream.h>
// IWYU pragma: no_include <__cstddef/byte.h>

#include <array>
#include <cstddef>
#include <cstddef> // IWYU pragma: keep
#include <cstdint>
#ifndef NDEBUG
#include <iostream>
Expand Down
5 changes: 1 addition & 4 deletions examples/example_art.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
// self-containedness does not concern with exception handling and refactoring
// the duplicated code with other examples.

// IWYU pragma: no_include <__ostream/basic_ostream.h>
// IWYU pragma: no_include <span>

#include "global.hpp" // IWYU pragma: keep
#include "global.hpp"

#include <cstddef>
#include <iostream>
Expand Down
4 changes: 1 addition & 3 deletions examples/example_art_stats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
// self-containedness does not concern with exception handling and refactoring
// the duplicated code with other examples.

// IWYU pragma: no_include <__ostream/basic_ostream.h>

#include "global.hpp" // IWYU pragma: keep
#include "global.hpp"

#include <cstddef>
#include <iostream>
Expand Down
6 changes: 1 addition & 5 deletions examples/example_olc_art.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
// self-containedness does not concern with exception handling and refactoring
// the duplicated code with other examples.

// IWYU pragma: no_include <__ostream/basic_ostream.h>
// IWYU pragma: no_include <allocator>
// IWYU pragma: no_include <memory>

#include "global.hpp" // IWYU pragma: keep
#include "global.hpp"

// std::cerr should be safe to access from different threads if it is
// synchronized with the C streams, yet TSan under XCode gives diagnostics.
Expand Down
4 changes: 2 additions & 2 deletions fuzz_deepstate/test_art_fuzz_deepstate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#include <deepstate/DeepState.h>
#include <deepstate/DeepState.hpp>

#include "art.hpp"
#include "art_common.hpp"
#include "art.hpp" // IWYU pragma: keep
#include "art_common.hpp" // IWYU pragma: keep
#include "deepstate_utils.hpp"
#include "node_type.hpp"
#include "test_heap.hpp"
Expand Down
2 changes: 1 addition & 1 deletion heap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/// Aligned heap memory allocation.

// Should be the first include
#include "global.hpp" // IWYU pragma: keep
#include "global.hpp"

#include <algorithm>
#ifndef NDEBUG
Expand Down
2 changes: 1 addition & 1 deletion in_fake_critical_section.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/// and concurrent use cases.

// Should be the first include
#include "global.hpp" // IWYU pragma: keep
#include "global.hpp"

#include <cstddef>

Expand Down
4 changes: 1 addition & 3 deletions mutex_art.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@
#define UNODB_DETAIL_MUTEX_ART_HPP

// Should be the first include
#include "global.hpp" // IWYU pragma: keep
#include "global.hpp"

#include <cassert>
#include <mutex>
#include <type_traits>
#include <utility>

#include "art.hpp"
#include "assert.hpp"
#include "node_type.hpp"

Comment thread
coderabbitai[bot] marked this conversation as resolved.
namespace unodb {

Expand Down
4 changes: 1 addition & 3 deletions olc_art.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
/// Concurrent Adaptive Radix Tree based on Optimistic Lock Coupling

// Should be the first include
#include "global.hpp" // IWYU pragma: keep

// IWYU pragma: no_include <__ostream/basic_ostream.h>
#include "global.hpp"

#include <array>
#include <atomic>
Expand Down
4 changes: 1 addition & 3 deletions optimistic_lock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,15 +211,13 @@
/// \}

// Should be the first include
#include "global.hpp" // IWYU pragma: keep
#include "global.hpp"

#include <atomic>
#include <cstddef>
#include <cstdint>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <optional>
#include <thread>
#include <tuple>
#include <type_traits>
Expand Down
2 changes: 1 addition & 1 deletion portability_builtins.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/// \ingroup internal

// Should be the first include
#include "global.hpp" // IWYU pragma: keep
#include "global.hpp"

#include <cstdint>
#include <cstring>
Expand Down Expand Up @@ -61,35 +61,35 @@
T x) noexcept {
static_assert(std::is_same_v<unsigned, T> ||
// NOLINTNEXTLINE(google-runtime-int)
std::is_same_v<unsigned long, T> || // NOLINT(runtime/int)

Check notice on line 64 in portability_builtins.hpp

View check run for this annotation

codefactor.io / CodeFactor

portability_builtins.hpp#L64

Use int16_t/int64_t/etc, rather than the C type long. (runtime/int)
// NOLINTNEXTLINE(google-runtime-int)
std::is_same_v<unsigned long long, T>); // NOLINT(runtime/int)

Check notice on line 66 in portability_builtins.hpp

View check run for this annotation

codefactor.io / CodeFactor

portability_builtins.hpp#L66

Use int16_t/int64_t/etc, rather than the C type long. (runtime/int)

if constexpr (std::is_same_v<unsigned, T>) {
#ifndef UNODB_DETAIL_MSVC
return static_cast<std::uint8_t>(__builtin_ctz(x));
#else
unsigned long result; // NOLINT(runtime/int)

Check notice on line 72 in portability_builtins.hpp

View check run for this annotation

codefactor.io / CodeFactor

portability_builtins.hpp#L72

Use int16_t/int64_t/etc, rather than the C type long. (runtime/int)
_BitScanForward(&result, x);
return static_cast<std::uint8_t>(result);
#endif
}
// NOLINTNEXTLINE(google-runtime-int)
if constexpr (std::is_same_v<unsigned long, T>) { // NOLINT(runtime/int)

Check notice on line 78 in portability_builtins.hpp

View check run for this annotation

codefactor.io / CodeFactor

portability_builtins.hpp#L78

Use int16_t/int64_t/etc, rather than the C type long. (runtime/int)
#ifndef UNODB_DETAIL_MSVC
return static_cast<std::uint8_t>(__builtin_ctzl(x));
#else
unsigned long result; // NOLINT(runtime/int)

Check notice on line 82 in portability_builtins.hpp

View check run for this annotation

codefactor.io / CodeFactor

portability_builtins.hpp#L82

Use int16_t/int64_t/etc, rather than the C type long. (runtime/int)
_BitScanForward(&result, x);
return static_cast<std::uint8_t>(result);
#endif
}
// NOLINTNEXTLINE(google-runtime-int)
if constexpr (std::is_same_v<unsigned long long, T>) { // NOLINT(runtime/int)

Check notice on line 88 in portability_builtins.hpp

View check run for this annotation

codefactor.io / CodeFactor

portability_builtins.hpp#L88

Use int16_t/int64_t/etc, rather than the C type long. (runtime/int)
#ifndef UNODB_DETAIL_MSVC
return static_cast<std::uint8_t>(__builtin_ctzll(x));
#else
unsigned long result; // NOLINT(runtime/int)

Check notice on line 92 in portability_builtins.hpp

View check run for this annotation

codefactor.io / CodeFactor

portability_builtins.hpp#L92

Use int16_t/int64_t/etc, rather than the C type long. (runtime/int)
_BitScanForward64(&result, x);
return static_cast<std::uint8_t>(result);
#endif
Expand Down
5 changes: 3 additions & 2 deletions qsbr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
/// registration and orphaned deallocation request list management helpers.

// Should be the first include
#include "global.hpp" // IWYU pragma: keep
#include "global.hpp"

// IWYU pragma: no_include <__new/exceptions.h>
// IWYU pragma: no_include <__hash_table>

#include "qsbr.hpp"
Expand All @@ -20,7 +21,7 @@
#include <exception>
#include <iostream>
#include <memory>
#include <new>
#include <new> // IWYU pragma: keep
#include <utility>

#ifdef UNODB_DETAIL_WITH_STATS
Expand Down
6 changes: 3 additions & 3 deletions qsbr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
/// https://preshing.com/20160726/using-quiescent-states-to-reclaim-memory/

// Should be the first include
#include "global.hpp" // IWYU pragma: keep
#include "global.hpp"

// IWYU pragma: no_include <__fwd/ostream.h>
// IWYU pragma: no_include <__ostream/basic_ostream.h>
// IWYU pragma: no_include <__vector/vector.h>
// IWYU pragma: no_include <boost/fusion/algorithm/iteration/for_each.hpp>
// IWYU pragma: no_include <boost/fusion/algorithm/query/find_if.hpp>
// IWYU pragma: no_include <boost/fusion/iterator/next.hpp>
Expand All @@ -43,7 +43,7 @@
#include <thread>
#include <type_traits>
#include <utility>
#include <vector>
#include <vector> // IWYU pragma: keep

#ifndef NDEBUG
#include <functional>
Expand Down
Loading
Loading