D-Bus 1.13.18

Data Fields
DBusHashTable Struct Reference
D-Bus secret internal implementation details » Hash table implementation details

Internals of DBusHashTable. More...

## Data Fields
int | refcount
| Reference count. More...
DBusHashEntry ** | buckets
| Pointer to bucket array. More...
DBusHashEntry * | static_buckets [DBUS_SMALL_HASH_TABLE]
| Bucket array used for small tables (to avoid mallocs and frees). More...
int | n_buckets
| Total number of buckets allocated at **buckets. More...
int | n_entries
| Total number of entries present in table. More...
int | hi_rebuild_size
| Enlarge table when n_entries gets to be this large. More...
int | lo_rebuild_size
| Shrink table when n_entries gets below this. More...
int | down_shift
| Shift count used in hashing function. More...
int | mask
| Mask value used in hashing function. More...
DBusHashType | key_type
| Type of keys used in this table. More...
DBusFindEntryFunction | find_function
| Function for finding entries. More...
DBusFreeFunction | free_key_function
| Function to free keys. More...
DBusFreeFunction | free_value_function
| Function to free values. More...
DBusMemPool * | entry_pool
| Memory pool for hash entries. More...

## Detailed Description

Internals of DBusHashTable.

Hash table internals. Hash tables are opaque objects, they must be used via accessor functions.

Definition at line 174 of file dbus-hash.c.

## Field Documentation

## ◆ buckets

DBusHashEntry** DBusHashTable::buckets

Pointer to bucket array.

Each element points to first entry in bucket's hash chain, or NULL.

Definition at line 177 of file dbus-hash.c.

Referenced by _dbus_hash_table_new(), and _dbus_hash_table_unref().

## ◆ down_shift

int DBusHashTable::down_shift

Shift count used in hashing function.

Designed to use high- order bits of randomized keys.

Definition at line 197 of file dbus-hash.c.

Referenced by _dbus_hash_table_new().

## ◆ entry_pool

DBusMemPool* DBusHashTable::entry_pool

Memory pool for hash entries.

Definition at line 212 of file dbus-hash.c.

Referenced by _dbus_hash_table_free_preallocated_entry(), and _dbus_hash_table_new().

## ◆ find_function

DBusFindEntryFunction DBusHashTable::find_function

Function for finding entries.

Definition at line 207 of file dbus-hash.c.

Referenced by _dbus_hash_table_insert_int(), _dbus_hash_table_insert_string_preallocated(), _dbus_hash_table_insert_uintptr(), _dbus_hash_table_lookup_int(), _dbus_hash_table_lookup_string(), _dbus_hash_table_lookup_uintptr(), _dbus_hash_table_new(), _dbus_hash_table_remove_int(), _dbus_hash_table_remove_string(), and _dbus_hash_table_remove_uintptr().

## ◆ free_key_function

DBusFreeFunction DBusHashTable::free_key_function

Function to free keys.

Definition at line 209 of file dbus-hash.c.

Referenced by _dbus_hash_table_insert_int(), _dbus_hash_table_insert_string_preallocated(), and _dbus_hash_table_insert_uintptr().

## ◆ free_value_function

DBusFreeFunction DBusHashTable::free_value_function

Function to free values.

Definition at line 210 of file dbus-hash.c.

Referenced by _dbus_hash_iter_set_value(), _dbus_hash_table_insert_int(), _dbus_hash_table_insert_string_preallocated(), and _dbus_hash_table_insert_uintptr().

## ◆ hi_rebuild_size

int DBusHashTable::hi_rebuild_size

Enlarge table when n_entries gets to be this large.

Definition at line 191 of file dbus-hash.c.

Referenced by _dbus_hash_table_new().

## ◆ key_type

DBusHashType DBusHashTable::key_type

Type of keys used in this table.

Definition at line 204 of file dbus-hash.c.

Referenced by _dbus_hash_table_insert_int(), _dbus_hash_table_insert_string(), _dbus_hash_table_insert_string_preallocated(), _dbus_hash_table_insert_uintptr(), _dbus_hash_table_lookup_int(), _dbus_hash_table_lookup_string(), _dbus_hash_table_lookup_uintptr(), _dbus_hash_table_new(), _dbus_hash_table_remove_int(), _dbus_hash_table_remove_string(), and _dbus_hash_table_remove_uintptr().

## ◆ lo_rebuild_size

int DBusHashTable::lo_rebuild_size

Shrink table when n_entries gets below this.

Definition at line 194 of file dbus-hash.c.

Referenced by _dbus_hash_table_new().

## ◆ mask

int DBusHashTable::mask

Mask value used in hashing function.

Definition at line 201 of file dbus-hash.c.

Referenced by _dbus_hash_table_new().

## ◆ n_buckets

int DBusHashTable::n_buckets

Total number of buckets allocated at **buckets.

Definition at line 185 of file dbus-hash.c.

Referenced by _dbus_hash_table_new(), and _dbus_hash_table_unref().

## ◆ n_entries

int DBusHashTable::n_entries

Total number of entries present in table.

Definition at line 188 of file dbus-hash.c.

Referenced by _dbus_hash_table_get_n_entries(), and _dbus_hash_table_new().

## ◆ refcount

int DBusHashTable::refcount

Reference count.

Definition at line 175 of file dbus-hash.c.

Referenced by _dbus_hash_table_new(), _dbus_hash_table_ref(), and _dbus_hash_table_unref().

## ◆ static_buckets

DBusHashEntry* DBusHashTable::static_buckets[DBUS_SMALL_HASH_TABLE]

Bucket array used for small tables (to avoid mallocs and frees).

Definition at line 181 of file dbus-hash.c.

Referenced by _dbus_hash_table_new().

The documentation for this struct was generated from the following file:

- dbus-hash.c