Skip to content

Commit

Permalink
inline
Browse files Browse the repository at this point in the history
  • Loading branch information
nickgerrets committed Jul 12, 2023
1 parent f16c1a8 commit 098fc31
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions src/include/duckdb/common/bitpacking.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,19 +205,19 @@ class BitpackingPrimitives {
}

template <class T>
static void PackGroup(data_ptr_t dst, T *values, bitpacking_width_t width) {
static inline void PackGroup(data_ptr_t dst, T *values, bitpacking_width_t width) {
// packing reinterprets the integral type as it's unsigned counterpart,
// except for hugeints which are exclusively signed (for now)
PackGroupImpl(dst, reinterpret_cast<typename MakeUnsigned<T>::type *>(values), width);
}

template <class T>
static void PackGroupImpl(data_ptr_t dst, T *values, bitpacking_width_t width) {
static inline void PackGroupImpl(data_ptr_t dst, T *values, bitpacking_width_t width) {
throw InternalException("Unsupported type for bitpacking");
}

template <class T>
static void UnPackGroup(data_ptr_t dst, data_ptr_t src, bitpacking_width_t width,
static inline void UnPackGroup(data_ptr_t dst, data_ptr_t src, bitpacking_width_t width,
bool skip_sign_extension = false) {
UnPackGroupImpl(reinterpret_cast<typename MakeUnsigned<T>::type *>(dst), src, width);

Expand All @@ -227,7 +227,7 @@ class BitpackingPrimitives {
}

template <class T>
static void UnPackGroupImpl(T *dst, data_ptr_t src, bitpacking_width_t width) {
static inline void UnPackGroupImpl(T *dst, data_ptr_t src, bitpacking_width_t width) {
throw InternalException("Unsupported type for bitpacking");
}
};
Expand Down
20 changes: 10 additions & 10 deletions src/storage/compression/bitpacking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -950,44 +950,44 @@ bool BitpackingFun::TypeIsSupported(PhysicalType type) {
//===--------------------------------------------------------------------===//

template <>
void BitpackingPrimitives::UnPackGroupImpl(uint8_t *dst, data_ptr_t src, bitpacking_width_t width) {
inline void BitpackingPrimitives::UnPackGroupImpl(uint8_t *dst, data_ptr_t src, bitpacking_width_t width) {
duckdb_fastpforlib::fastunpack(reinterpret_cast<const uint8_t *>(src), dst, static_cast<uint32_t>(width));
}
template <>
void BitpackingPrimitives::UnPackGroupImpl(uint16_t *dst, data_ptr_t src, bitpacking_width_t width) {
inline void BitpackingPrimitives::UnPackGroupImpl(uint16_t *dst, data_ptr_t src, bitpacking_width_t width) {
duckdb_fastpforlib::fastunpack(reinterpret_cast<const uint16_t *>(src), dst, static_cast<uint32_t>(width));
}
template <>
void BitpackingPrimitives::UnPackGroupImpl(uint32_t *dst, data_ptr_t src, bitpacking_width_t width) {
inline void BitpackingPrimitives::UnPackGroupImpl(uint32_t *dst, data_ptr_t src, bitpacking_width_t width) {
duckdb_fastpforlib::fastunpack(reinterpret_cast<const uint32_t *>(src), dst, static_cast<uint32_t>(width));
}
template <>
void BitpackingPrimitives::UnPackGroupImpl(uint64_t *dst, data_ptr_t src, bitpacking_width_t width) {
inline void BitpackingPrimitives::UnPackGroupImpl(uint64_t *dst, data_ptr_t src, bitpacking_width_t width) {
duckdb_fastpforlib::fastunpack(reinterpret_cast<const uint32_t *>(src), dst, static_cast<uint32_t>(width));
}
template <>
void BitpackingPrimitives::UnPackGroupImpl(hugeint_t *dst, data_ptr_t src, bitpacking_width_t width) {
inline void BitpackingPrimitives::UnPackGroupImpl(hugeint_t *dst, data_ptr_t src, bitpacking_width_t width) {
HugeIntPacker::Unpack(reinterpret_cast<const uint32_t *>(src), dst, width);
}

template <>
void BitpackingPrimitives::PackGroupImpl(data_ptr_t dst, uint8_t *values, bitpacking_width_t width) {
inline void BitpackingPrimitives::PackGroupImpl(data_ptr_t dst, uint8_t *values, bitpacking_width_t width) {
duckdb_fastpforlib::fastpack(values, reinterpret_cast<uint8_t *>(dst), static_cast<uint32_t>(width));
}
template <>
void BitpackingPrimitives::PackGroupImpl(data_ptr_t dst, uint16_t *values, bitpacking_width_t width) {
inline void BitpackingPrimitives::PackGroupImpl(data_ptr_t dst, uint16_t *values, bitpacking_width_t width) {
duckdb_fastpforlib::fastpack(values, reinterpret_cast<uint16_t *>(dst), static_cast<uint32_t>(width));
}
template <>
void BitpackingPrimitives::PackGroupImpl(data_ptr_t dst, uint32_t *values, bitpacking_width_t width) {
inline void BitpackingPrimitives::PackGroupImpl(data_ptr_t dst, uint32_t *values, bitpacking_width_t width) {
duckdb_fastpforlib::fastpack(values, reinterpret_cast<uint32_t *>(dst), static_cast<uint32_t>(width));
}
template <>
void BitpackingPrimitives::PackGroupImpl(data_ptr_t dst, uint64_t *values, bitpacking_width_t width) {
inline void BitpackingPrimitives::PackGroupImpl(data_ptr_t dst, uint64_t *values, bitpacking_width_t width) {
duckdb_fastpforlib::fastpack(values, reinterpret_cast<uint32_t *>(dst), static_cast<uint32_t>(width));
}
template <>
void BitpackingPrimitives::PackGroupImpl(data_ptr_t dst, hugeint_t *values, bitpacking_width_t width) {
inline void BitpackingPrimitives::PackGroupImpl(data_ptr_t dst, hugeint_t *values, bitpacking_width_t width) {
HugeIntPacker::Pack(values, reinterpret_cast<uint32_t *>(dst), width);
}

Expand Down

0 comments on commit 098fc31

Please sign in to comment.