24 const uint32_t GroupVarint32::kMask[] = {
31 const uint64_t GroupVarint64::kMask[] = {
39 0xffffffffffffffffULL,
44 struct group_varint_table_base_make_item {
45 constexpr std::size_t get_d(std::size_t index, std::size_t j)
const {
46 return 1u + ((index >> (2 * j)) & 3u);
48 constexpr std::size_t get_offset(std::size_t index, std::size_t j)
const {
51 (j > 0 ? get_d(index, 0) : 0) +
52 (j > 1 ? get_d(index, 1) : 0) +
53 (j > 2 ? get_d(index, 2) : 0) +
54 (j > 3 ? get_d(index, 3) : 0) +
60 struct group_varint_table_length_make_item : group_varint_table_base_make_item {
61 constexpr
std::uint8_t operator()(std::size_t index)
const {
62 return 1u + get_offset(index, 4);
106 struct group_varint_table_sse_mask_make_item
107 : group_varint_table_base_make_item {
108 constexpr
auto partial_item(std::size_t d, std::size_t offset, std::size_t
k)
113 return std::uint32_t((k < d ? offset + k : std::size_t(0xff)) << (8 * k));
116 constexpr
auto item_impl(std::size_t d, std::size_t offset)
const {
119 partial_item(d, offset, 0) |
120 partial_item(d, offset, 1) |
121 partial_item(d, offset, 2) |
122 partial_item(d, offset, 3) |
127 constexpr
auto item(std::size_t index, std::size_t j)
const {
128 return item_impl(get_d(index, j), get_offset(index, j));
131 constexpr
auto operator()(std::size_t index)
const {
132 return std::array<std::uint32_t, 4>{{
143 decltype(groupVarintSSEMasks) groupVarintSSEMasks =
144 make_array_with<256>(group_varint_table_sse_mask_make_item{});
—— Concurrent Priority Queue Implementation ——
#define FOLLY_STORAGE_CONSTEXPR
constexpr auto make_array_with(MakeItem const &make)