The ht_entry_t struct represents an individual entry within a hash table.
More...
|
|
static constexpr const hash_t | SALT_MASK = 0xFFFF000000000000 |
| | Upper 16 bits are salt, lower 48 bits are the pointer.
|
|
static constexpr const hash_t | POINTER_MASK = 0x0000FFFFFFFFFFFF |
The ht_entry_t struct represents an individual entry within a hash table.
This struct is used by the JoinHashTable and AggregateHashTable to store entries within the hash table. It stores a pointer to the data and a salt value in a single hash_t and can return or modify the pointer and salt individually.
◆ ht_entry_t() [1/3]
| duckdb::ht_entry_t::ht_entry_t |
( |
| ) |
|
|
inlinenoexcept |
145724 : value(0) {
145725 }
◆ ht_entry_t() [2/3]
| duckdb::ht_entry_t::ht_entry_t |
( |
hash_t | value_p | ) |
|
|
inlineexplicitnoexcept |
145727 : value(value_p) {
145728 }
◆ ht_entry_t() [3/3]
| duckdb::ht_entry_t::ht_entry_t |
( |
const hash_t & | salt, |
|
|
const data_ptr_t & | pointer ) |
|
inline |
145731 : value(cast_pointer_to_uint64(pointer) | (salt &
SALT_MASK)) {
145732 }
static constexpr const hash_t SALT_MASK
Upper 16 bits are salt, lower 48 bits are the pointer.
Definition duckdb.cpp:145720
◆ IsOccupied()
| bool duckdb::ht_entry_t::IsOccupied |
( |
| ) |
const |
|
inline |
145734 {
145735 return value != 0;
145736 }
◆ GetPointer()
| data_ptr_t duckdb::ht_entry_t::GetPointer |
( |
| ) |
const |
|
inline |
Returns a pointer based on the stored value (asserts if the cell is occupied).
145739 {
145740 D_ASSERT(IsOccupied());
145742 }
data_ptr_t GetPointerOrNull() const
Returns a pointer based on the stored value.
Definition duckdb.cpp:145745
◆ GetPointerOrNull()
| data_ptr_t duckdb::ht_entry_t::GetPointerOrNull |
( |
| ) |
const |
|
inline |
Returns a pointer based on the stored value.
145745 {
145746 return cast_uint64_to_pointer(value & POINTER_MASK);
145747 }
◆ SetPointer()
| void duckdb::ht_entry_t::SetPointer |
( |
const data_ptr_t & | pointer | ) |
|
|
inline |
145749 {
145750
145751 D_ASSERT((cast_pointer_to_uint64(pointer) &
SALT_MASK) == 0);
145752
145753 D_ASSERT((value & POINTER_MASK) == POINTER_MASK);
145754
145755 value &= cast_pointer_to_uint64(pointer) |
SALT_MASK;
145756 }
◆ ExtractSalt()
| hash_t duckdb::ht_entry_t::ExtractSalt |
( |
const hash_t & | hash | ) |
|
|
inlinestatic |
145759 {
145760 return hash | POINTER_MASK;
145761 }
◆ GetSalt()
| hash_t duckdb::ht_entry_t::GetSalt |
( |
| ) |
const |
|
inline |
145763 {
145764 return ExtractSalt(value);
145765 }
◆ GetSaltWithNulls()
| hash_t duckdb::ht_entry_t::GetSaltWithNulls |
( |
| ) |
const |
|
inline |
◆ SetSalt()
| void duckdb::ht_entry_t::SetSalt |
( |
const hash_t & | salt | ) |
|
|
inline |
145771 {
145772
145773 D_ASSERT(!IsOccupied());
145774
145775 D_ASSERT((salt & POINTER_MASK) == POINTER_MASK);
145776
145777 value = salt;
145778 }
The documentation for this struct was generated from the following file: