PostgreSQL Source Code
git master
|
#include "utils/dsa.h"
Go to the source code of this file.
Data Structures | |
struct | dshash_parameters |
Typedefs | |
typedef struct dshash_table | dshash_table |
typedef dsa_pointer | dshash_table_handle |
typedef uint32 | dshash_hash |
typedef int(* | dshash_compare_function) (const void *a, const void *b, size_t size, void *arg) |
typedef dshash_hash(* | dshash_hash_function) (const void *v, size_t size, void *arg) |
typedef struct dshash_parameters | dshash_parameters |
typedef struct dshash_table_item | dshash_table_item |
Functions | |
dshash_table * | dshash_create (dsa_area *area, const dshash_parameters *params, void *arg) |
dshash_table * | dshash_attach (dsa_area *area, const dshash_parameters *params, dshash_table_handle handle, void *arg) |
void | dshash_detach (dshash_table *hash_table) |
dshash_table_handle | dshash_get_hash_table_handle (dshash_table *hash_table) |
void | dshash_destroy (dshash_table *hash_table) |
void * | dshash_find (dshash_table *hash_table, const void *key, bool exclusive) |
void * | dshash_find_or_insert (dshash_table *hash_table, const void *key, bool *found) |
bool | dshash_delete_key (dshash_table *hash_table, const void *key) |
void | dshash_delete_entry (dshash_table *hash_table, void *entry) |
void | dshash_release_lock (dshash_table *hash_table, void *entry) |
int | dshash_memcmp (const void *a, const void *b, size_t size, void *arg) |
dshash_hash | dshash_memhash (const void *v, size_t size, void *arg) |
void | dshash_dump (dshash_table *hash_table) |
typedef int(* dshash_compare_function) (const void *a, const void *b, size_t size, void *arg) |
typedef uint32 dshash_hash |
typedef dshash_hash(* dshash_hash_function) (const void *v, size_t size, void *arg) |
typedef struct dshash_parameters dshash_parameters |
typedef struct dshash_table dshash_table |
typedef dsa_pointer dshash_table_handle |
typedef struct dshash_table_item dshash_table_item |
dshash_table* dshash_attach | ( | dsa_area * | area, |
const dshash_parameters * | params, | ||
dshash_table_handle | handle, | ||
void * | arg | ||
) |
Definition at line 263 of file dshash.c.
References dshash_table::area, arg, dshash_table::arg, Assert, dshash_table::buckets, dshash_table::control, dsa_get_address(), DSHASH_MAGIC, dshash_table::find_exclusively_locked, dshash_table::find_locked, dshash_table_control::magic, palloc(), dshash_table::params, and dshash_table::size_log2.
Referenced by SharedRecordTypmodRegistryAttach().
dshash_table* dshash_create | ( | dsa_area * | area, |
const dshash_parameters * | params, | ||
void * | arg | ||
) |
Definition at line 196 of file dshash.c.
References dshash_table::area, arg, dshash_table::arg, dshash_table_control::buckets, dshash_table::buckets, dshash_table::control, dshash_partition::count, DSA_ALLOC_NO_OOM, DSA_ALLOC_ZERO, dsa_allocate, dsa_allocate_extended(), dsa_free(), dsa_get_address(), DsaPointerIsValid, DSHASH_MAGIC, DSHASH_NUM_PARTITIONS, DSHASH_NUM_PARTITIONS_LOG2, ereport, errcode(), errdetail(), errmsg(), ERROR, dshash_table::find_exclusively_locked, dshash_table::find_locked, dshash_table_control::handle, i, dshash_table_control::lwlock_tranche_id, LWLockInitialize(), dshash_table_control::magic, palloc(), dshash_table::params, dshash_table_control::partitions, partitions, dshash_table_control::size_log2, dshash_table::size_log2, and dshash_parameters::tranche_id.
Referenced by SharedRecordTypmodRegistryInit().
void dshash_delete_entry | ( | dshash_table * | hash_table, |
void * | entry | ||
) |
Definition at line 540 of file dshash.c.
References Assert, dshash_table::control, delete_item(), DSHASH_MAGIC, dshash_table::find_exclusively_locked, dshash_table::find_locked, dshash_table_item::hash, ITEM_FROM_ENTRY, LW_EXCLUSIVE, LWLockHeldByMeInMode(), LWLockRelease(), dshash_table_control::magic, PARTITION_FOR_HASH, and PARTITION_LOCK.
bool dshash_delete_key | ( | dshash_table * | hash_table, |
const void * | key | ||
) |
Definition at line 502 of file dshash.c.
References Assert, BUCKET_FOR_HASH, dshash_table::control, dshash_partition::count, delete_key_from_bucket(), DSHASH_MAGIC, ensure_valid_bucket_pointers(), dshash_table::find_locked, dshash_table_item::hash, hash_key(), LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), dshash_table_control::magic, PARTITION_FOR_HASH, PARTITION_LOCK, and dshash_table_control::partitions.
Referenced by find_or_make_matching_shared_tupledesc().
void dshash_destroy | ( | dshash_table * | hash_table | ) |
Definition at line 318 of file dshash.c.
References dshash_table::area, Assert, dshash_table_control::buckets, dshash_table::buckets, dshash_table::control, dsa_free(), dsa_get_address(), DsaPointerIsValid, DSHASH_MAGIC, ensure_valid_bucket_pointers(), dshash_table_control::handle, i, dshash_table_control::magic, dshash_table_item::next, pfree(), and dshash_table::size_log2.
void dshash_detach | ( | dshash_table * | hash_table | ) |
Definition at line 302 of file dshash.c.
References Assert, dshash_table::find_locked, and pfree().
Referenced by shared_record_typmod_registry_detach().
void dshash_dump | ( | dshash_table * | hash_table | ) |
Definition at line 600 of file dshash.c.
References dshash_table::area, Assert, BUCKET_INDEX_FOR_PARTITION, dshash_table::buckets, dshash_table::control, dshash_partition::count, dsa_get_address(), DsaPointerIsValid, DSHASH_MAGIC, DSHASH_NUM_PARTITIONS, ensure_valid_bucket_pointers(), dshash_table::find_locked, fprintf, i, LW_SHARED, LWLockAcquire(), LWLockHeldByMe(), LWLockRelease(), dshash_table_control::magic, dshash_table_item::next, PARTITION_LOCK, dshash_table_control::partitions, and dshash_table::size_log2.
void* dshash_find | ( | dshash_table * | hash_table, |
const void * | key, | ||
bool | exclusive | ||
) |
Definition at line 385 of file dshash.c.
References Assert, BUCKET_FOR_HASH, dshash_table::control, DSHASH_MAGIC, ensure_valid_bucket_pointers(), ENTRY_FROM_ITEM, dshash_table::find_exclusively_locked, find_in_bucket(), dshash_table::find_locked, dshash_table_item::hash, hash_key(), LW_EXCLUSIVE, LW_SHARED, LWLockAcquire(), LWLockRelease(), dshash_table_control::magic, PARTITION_FOR_HASH, and PARTITION_LOCK.
Referenced by find_or_make_matching_shared_tupledesc(), and lookup_rowtype_tupdesc_internal().
void* dshash_find_or_insert | ( | dshash_table * | hash_table, |
const void * | key, | ||
bool * | found | ||
) |
Definition at line 430 of file dshash.c.
References Assert, BUCKET_FOR_HASH, dshash_table::control, dshash_partition::count, DSHASH_MAGIC, ensure_valid_bucket_pointers(), ENTRY_FROM_ITEM, dshash_table::find_exclusively_locked, find_in_bucket(), dshash_table::find_locked, dshash_table_item::hash, hash_key(), insert_into_bucket(), LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), dshash_table_control::magic, MAX_COUNT_PER_PARTITION, PARTITION_FOR_HASH, PARTITION_LOCK, dshash_table_control::partitions, resize(), and dshash_table::size_log2.
Referenced by find_or_make_matching_shared_tupledesc(), and SharedRecordTypmodRegistryInit().
dshash_table_handle dshash_get_hash_table_handle | ( | dshash_table * | hash_table | ) |
Definition at line 362 of file dshash.c.
References Assert, dshash_table::control, DSHASH_MAGIC, dshash_table_control::handle, and dshash_table_control::magic.
Referenced by SharedRecordTypmodRegistryInit().
int dshash_memcmp | ( | const void * | a, |
const void * | b, | ||
size_t | size, | ||
void * | arg | ||
) |
dshash_hash dshash_memhash | ( | const void * | v, |
size_t | size, | ||
void * | arg | ||
) |
void dshash_release_lock | ( | dshash_table * | hash_table, |
void * | entry | ||
) |
Definition at line 561 of file dshash.c.
References Assert, dshash_table::control, DSHASH_MAGIC, dshash_table::find_exclusively_locked, dshash_table::find_locked, dshash_table_item::hash, ITEM_FROM_ENTRY, LW_EXCLUSIVE, LW_SHARED, LWLockHeldByMeInMode(), LWLockRelease(), dshash_table_control::magic, PARTITION_FOR_HASH, and PARTITION_LOCK.
Referenced by find_or_make_matching_shared_tupledesc(), lookup_rowtype_tupdesc_internal(), and SharedRecordTypmodRegistryInit().